-
-
Save thwd/2b965b7912fea68b93d2 to your computer and use it in GitHub Desktop.
1996 repro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"reflect" | |
) | |
func foo() func(int) { | |
return nil | |
} | |
func main() { | |
i := reflect.TypeOf(foo).Out(0).In(0) | |
t := reflect.FuncOf([]reflect.Type{i}, nil, false) | |
v := reflect.MakeFunc(t, func(in []reflect.Value) []reflect.Value { | |
return nil | |
}) | |
v.Interface().(func(int))(1) | |
} |
Author
thwd
commented
Feb 14, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment