Source file
test/abi/open_defer_1.go
1
2
3
4
5
6
7
8
9 package main
10
11 func main() {
12 var x, y, z int = -1, -2, -3
13 F(x, y, z)
14 }
15
16
17 func F(x, y, z int) {
18 defer i.M(x, y, z)
19 defer func() { recover() }()
20 panic("XXX")
21 }
22
23 type T int
24
25 func (t *T) M(x, y, z int) {
26 if x == -1 && y == -2 && z == -3 {
27 return
28 }
29 println("FAIL: Expected -1, -2, -3, but x, y, z =", x, y, z)
30 }
31
32 var t T = 42
33
34 type I interface{ M(x, y, z int) }
35
36 var i I = &t
37
View as plain text