...
1
2
3
4
5 package p
6
7 func f1(func(int))
8 func f2(func(int), func(string))
9 func f3(func(int), func(string), func(float32))
10
11 func g1[P any](P) {}
12
13 func _() {
14 f1(g1)
15 f2(g1, g1)
16 f3(g1, g1, g1)
17 }
18
19
20
21 func g2[P any](P, P) {}
22 func h3[P any](func(P), func(P), func() P) {}
23 func h4[P, Q any](func(P), func(P, Q), func() Q, func(P, Q)) {}
24
25 func r1() int { return 0 }
26
27 func _() {
28 h3(g1, g1, r1)
29 h4(g1, g2, r1, g2)
30 }
31
32
33
34 func f(func(int))
35 func g[P any](P) {}
36
37 func d[P any](...func(P)) {}
38
39 func _() {
40 d ()
41 d(f)
42 d(f, g)
43 d(f, g, g)
44 d (g, g, g)
45 d(g, g, f)
46 d(g, f, g, f)
47 }
48
View as plain text