Skip to content

Commit 6e7c691

Browse files
committed
test: add simpler test for issue 50109
Thanks to the simpler test case for issue 50109. I'm keeping the old test case in place, since it's not too complex, and may be useful for testing other things as well. Updates #50109 Change-Id: I80cdbd1da473d0cc4dcbd68e45bab7ddb6f9263e Reviewed-on: https://go-review.googlesource.com/c/go/+/371515 Trust: Dan Scales <[email protected]> Run-TryBot: Dan Scales <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: roger peppe <[email protected]>
1 parent c9ffcca commit 6e7c691

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/typeparam/issue50109b.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// run -gcflags=-G=3
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+
}

0 commit comments

Comments
 (0)