Support returning any from callbacks (#1046)

Support returning any from callbacks
This commit is contained in:
Phil Eaton
2022-05-29 21:06:43 -04:00
committed by GitHub
parent b819467576
commit 3ccccfb4c9
3 changed files with 88 additions and 0 deletions

View File

@@ -102,3 +102,15 @@ func TestCallbackConverters(t *testing.T) {
}
}
}
func TestCallbackReturnAny(t *testing.T) {
udf := func() interface{} {
return 1
}
typ := reflect.TypeOf(udf)
_, err := callbackRet(typ.Out(0))
if err != nil {
t.Errorf("Expected valid callback for any return type, got: %s", err)
}
}