...
1
2
3
4
5 package p
6
7 import "unsafe"
8
9
10
11 type t interface {
12 f(u)
13 }
14
15 type u interface {
16 t
17 }
18
19 func _() {
20 var t t
21 var u u
22
23 t.f(t)
24 t.f(u)
25
26 u.f(t)
27 u.f(u)
28 }
29
30
31
32
33 type A interface {
34 a() interface {
35 AB
36 }
37 }
38
39 type B interface {
40 b() interface {
41 AB
42 }
43 }
44
45 type AB interface {
46 a() interface {
47 A
48 B
49 }
50 b() interface {
51 A
52 B
53 }
54 }
55
56 var x AB
57 var y interface {
58 A
59 B
60 }
61
62 var _ = x == y
63
64
65
66
67 type T interface {
68 m() [T(nil).m ()[0]]int
69 }
70
71
72
73 type T1 interface {
74 m() [x1.m()[0]]int
75 }
76
77 var x1 T1
78
79 type T2 interface {
80 m() [len(x2.m())]int
81 }
82
83 var x2 T2
84
85 type T3 interface {
86 m() [unsafe.Sizeof(x3.m)]int
87 }
88
89 var x3 T3
90
91 type T4 interface {
92 m() [unsafe.Sizeof(cast4(x4.m))]int
93 }
94
95 var x4 T4
96 var _ = cast4(x4.m)
97
98 type cast4 func()
99
View as plain text