1
2
3
4
5
6
7 package init1
8
9
10
11 type T0 struct{}
12
13 func (T0) m() int { return y0 }
14
15 var x0 = T0{}
16
17 var y0 = x0.m()
18
19 type T1 struct{}
20
21 func (T1) m() int { return y1 }
22
23 var x1 interface {
24 m() int
25 } = T1{}
26
27 var y1 = x1.m()
28
29
30
31 var x2 = T2.m
32
33 var y2 = x2
34
35 type T2 struct{}
36
37 func (T2) m() int {
38 _ = y2
39 return 0
40 }
41
42 var x3 = T3.m(T3{})
43
44 var y3 = x3
45
46 type T3 struct{}
47
48 func (T3) m() int {
49 _ = y3
50 return 0
51 }
52
53 var x4 = T4{}.m
54
55 var y4 = x4
56
57 type T4 struct{}
58
59 func (T4) m() int {
60 _ = y4
61 return 0
62 }
63
64 var x5 = T5{}.m()
65
66 var y5 = x5
67
68 type T5 struct{}
69
70 func (T5) m() int {
71 _ = y5
72 return 0
73 }
74
75
76
77
78 var x6 = f6
79 var y6 = f6
80 func f6() { _ = y6 }
81
82
83
84 type (
85 E int
86 S int
87 )
88
89 type matcher func(s *S) E
90
91 func matchList(s *S) E { return matcher(matchAnyFn)(s) }
92
93 var foo = matcher(matchList)
94
95 var matchAny = matcher(matchList)
96
97 func matchAnyFn(s *S) (err E) { return matchAny(s) }
View as plain text