Source file
test/fixedbugs/issue39541.go
1
2
3
4
5
6
7 package main
8
9 import "reflect"
10
11 func sub(args []reflect.Value) []reflect.Value {
12 type A struct {
13 s int
14 t int
15 }
16 return []reflect.Value{reflect.ValueOf(A{1, 2})}
17 }
18
19 func main() {
20 f := reflect.MakeFunc(reflect.TypeOf((func() interface{})(nil)), sub).Interface().(func() interface{})
21 c := make(chan bool, 100)
22 for i := 0; i < 100; i++ {
23 go func() {
24 for j := 0; j < 10000; j++ {
25 f()
26 }
27 c <- true
28 }()
29 }
30 for i := 0; i < 100; i++ {
31 <-c
32 }
33 }
34
View as plain text