mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
Type check was failing for expression such as: `&(*tree)[node:][0]`, as in ```go tree, _ := huffmanTreePool.Get().(*[]huffmanTree) ... initHuffmanTree(&(*tree)[node:][0], histogram[l], -1, int16(l)) ``` see https://github.com/andybalholm/brotli/blob/c3da72aa01ed78f164593b9624fd91d25082d2d2/brotli_bit_stream.go#L469
23 lines
221 B
Go
23 lines
221 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
type T struct {
|
|
A int
|
|
B int
|
|
}
|
|
|
|
func main() {
|
|
a := &[]T{
|
|
{1, 2},
|
|
{3, 4},
|
|
}
|
|
fmt.Println("a:", a)
|
|
x := &(*a)[1:][0]
|
|
fmt.Println("x:", x)
|
|
}
|
|
|
|
// Output:
|
|
// a: &[{1 2} {3 4}]
|
|
// x: &{3 4}
|