Source file
test/typeparam/issue54535.go
1
2
3
4
5
6
7 package main
8
9 type node[T any] struct {
10 items items[T]
11 children items[*node[T]]
12 }
13
14 func (n *node[T]) f(i int, j int) bool {
15 if len(n.children[i].items) < j {
16 return false
17 }
18 return true
19 }
20
21 type items[T any] []T
22
23 func main() {
24 _ = node[int]{}
25 _ = f[int]
26 }
27
28 type s[T, U any] struct {
29 a T
30 c U
31 }
32
33 func f[T any]() {
34 var x s[*struct{ b T }, *struct{ d int }]
35 _ = x.a.b
36 _ = x.c.d
37 }
38
View as plain text