...
1
2
3
4
5
6
7 package p
8
9 type MyInt int32
10 type MyBool bool
11 type MyString string
12 type MyFunc1 func(func(int) bool)
13 type MyFunc2 func(int) bool
14 type MyFunc3 func(MyFunc2)
15
16 type T struct{}
17
18 func (*T) PM() {}
19 func (T) M() {}
20
21 func f1() {}
22 func f2(func()) {}
23 func f4(func(int) bool) {}
24 func f5(func(int, string) bool) {}
25 func f7(func(int) MyBool) {}
26 func f8(func(MyInt, MyString) MyBool) {}
27
28 func test() {
29
30
31 m1 := T.M
32 for range m1 {
33 }
34 m2 := (*T).PM
35 for range m2 {
36 }
37 for range f1 {
38 }
39 for range f2 {
40 }
41 for range f4 {
42 }
43 for _ = range f4 {
44 }
45 for _, _ = range f5 {
46 }
47 for _ = range f7 {
48 }
49 for _, _ = range f8 {
50 }
51 for range 1 {
52 }
53 for range uint8(1) {
54 }
55 for range int64(1) {
56 }
57 for range MyInt(1) {
58 }
59 for range 'x' {
60 }
61 for range 1.0 {
62 }
63 for _ = range MyFunc1(nil) {
64 }
65 for _ = range MyFunc3(nil) {
66 }
67 for _ = range (func(MyFunc2))(nil) {
68 }
69
70 var i int
71 var s string
72 var mi MyInt
73 var ms MyString
74 for i := range f4 {
75 _ = i
76 }
77 for i = range f4 {
78 _ = i
79 }
80 for i, s := range f5 {
81 _, _ = i, s
82 }
83 for i, s = range f5 {
84 _, _ = i, s
85 }
86 for i, _ := range f5 {
87 _ = i
88 }
89 for i, _ = range f5 {
90 _ = i
91 }
92 for i := range f7 {
93 _ = i
94 }
95 for i = range f7 {
96 _ = i
97 }
98 for mi, _ := range f8 {
99 _ = mi
100 }
101 for mi, _ = range f8 {
102 _ = mi
103 }
104 for mi, ms := range f8 {
105 _, _ = mi, ms
106 }
107 for i , s = range f8 {
108 _, _ = mi, ms
109 }
110 for mi, ms := range f8 {
111 i, s = mi , ms
112 }
113 for mi, ms = range f8 {
114 _, _ = mi, ms
115 }
116
117 for i := range 10 {
118 _ = i
119 }
120 for i = range 10 {
121 _ = i
122 }
123 for i, j := range 10 {
124 _, _ = i, j
125 }
126 for mi := range MyInt(10) {
127 _ = mi
128 }
129 for mi = range MyInt(10) {
130 _ = mi
131 }
132 }
133
134 func _[T int | string](x T) {
135 for range x {
136 }
137 }
138
139 func _[T int | int64](x T) {
140 for range x {
141 }
142 }
143
144 func _[T ~int](x T) {
145 for range x {
146 }
147 }
148
149 func _[T any](x func(func(T) bool)) {
150 for _ = range x {
151 }
152 }
153
154 func _[T ~func(func(int) bool)](x T) {
155 for _ = range x {
156 }
157 }
158
View as plain text