diff options
Diffstat (limited to 'test/typeparam/interfacearg.go')
-rw-r--r-- | test/typeparam/interfacearg.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/typeparam/interfacearg.go b/test/typeparam/interfacearg.go index e2d85e3647..28ea3e3afb 100644 --- a/test/typeparam/interfacearg.go +++ b/test/typeparam/interfacearg.go @@ -9,23 +9,25 @@ package main type I interface{} type _S[T any] struct { - *T + x *T } // F is a non-generic function, but has a type _S[I] which is instantiated from a // generic type. Test that _S[I] is successfully exported. func F() { v := _S[I]{} - if v.T != nil { + if v.x != nil { panic(v) } } // Testing the various combinations of method expressions. type S1 struct{} + func (*S1) M() {} type S2 struct{} + func (S2) M() {} func _F1[T interface{ M() }](t T) { @@ -33,9 +35,9 @@ func _F1[T interface{ M() }](t T) { } func F2() { - _F1(&S1{}) - _F1(S2{}) - _F1(&S2{}) + _F1(&S1{}) + _F1(S2{}) + _F1(&S2{}) } func main() { |