Source file
test/typeparam/issue54225.go
1
2
3
4
5
6
7 package main
8
9 func main() {
10 One[TextValue]()
11 }
12
13 func One[V Value]() { Two[Node[V]]() }
14
15 func Two[V interface{ contentLen() int }]() {
16 var v V
17 v.contentLen()
18 }
19
20 type Value interface {
21 Len() int
22 }
23
24 type Node[V Value] struct{}
25
26 func (Node[V]) contentLen() int {
27 var value V
28 return value.Len()
29 }
30
31 type TextValue struct{}
32
33 func (TextValue) Len() int { return 0 }
34
View as plain text