Debian Codegraph @

src/internal/types/testdata/fixedbugs/issue49439.go

raw
1 // Copyright 2021 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package p
6
7 import "unsafe"
8
9 type T0[P T0[P]] struct{}
10
11 type T1[P T2[P /* ERROR "P does not satisfy T1[P]" */]] struct{}
12 type T2[P T1[P /* ERROR "P does not satisfy T2[P]" */]] struct{}
13
14 type T3[P interface{ ~struct{ f T3[int /* ERROR "int does not satisfy" */ ] } }] struct{}
15
16 // valid cycle in M
17 type N[P M[P]] struct{}
18 type M[Q any] struct{ F *M[Q] }
19
20 // "crazy" case
21 type TC[P [unsafe.Sizeof(func() {
22 type T[P [unsafe.Sizeof(func() {})]byte] struct{}
23 })]byte] struct{}
24
25 // test case from issue
26 type X[T any, PT X /* ERROR "not enough type arguments for type X" */ [T]] interface{}