Source file test/typeparam/issue50109b.go
1 // run 2 3 // Copyright 2021 The Go Authors. All rights reserved. 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file. 6 7 package main 8 9 func main() { 10 F[any]() 11 } 12 13 func F[T any]() I[T] { 14 return (*S1[T])(nil) 15 } 16 17 type I[T any] interface{} 18 19 type S1[T any] struct { 20 *S2[T] 21 } 22 23 type S2[T any] struct { 24 S3 *S3[T] 25 } 26 27 type S3[T any] struct { 28 x int 29 } 30