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