Source file
test/fixedbugs/issue16016.go
1
2
3
4
5
6
7 package main
8
9 import (
10 "runtime"
11 "time"
12 )
13
14 type T struct{}
15
16 func (*T) Foo(vals []interface{}) {
17 switch v := vals[0].(type) {
18 case string:
19 _ = v
20 }
21 }
22
23 type R struct{ *T }
24
25 type Q interface {
26 Foo([]interface{})
27 }
28
29 func main() {
30 var count = 10000
31 if runtime.Compiler == "gccgo" {
32
33
34
35 const intSize = 32 << (^uint(0) >> 63)
36 if intSize < 64 {
37 count = 100
38 }
39 }
40
41 var q Q = &R{&T{}}
42 for i := 0; i < count; i++ {
43 go func() {
44 defer q.Foo([]interface{}{"meow"})
45 time.Sleep(100 * time.Millisecond)
46 }()
47 }
48 time.Sleep(1 * time.Second)
49 }
50
View as plain text