Source file
test/fixedbugs/issue31419.go
1
2
3
4
5
6
7
8
9
10 package main
11
12 type T int
13
14 func (t T) M() {}
15
16 type I interface {
17 M()
18 M2()
19 }
20
21 var t T
22 var e interface{} = &t
23 var ok = false
24 var ch = make(chan int)
25
26 func main() {
27 _, ok = e.(I)
28
29 go f()
30
31 var i I
32 for k := 0; k < 10000; k++ {
33 i, ok = e.(I)
34 if ok {
35 println("iteration", k, "i =", i, "&t =", &t)
36 panic("conversion succeeded")
37 }
38 }
39 <-ch
40 }
41
42 func f() {
43 for i := 0; i < 10000; i++ {
44 f1()
45 }
46 ch <- 1
47 }
48
49 func f1() {
50 defer func() {
51 err := recover()
52 if err == nil {
53 panic("did not panic")
54 }
55 }()
56 i := e.(I)
57 _ = i
58 }
59
View as plain text