Open rcoreilly opened 5 months ago
sample.go
package main import ( "fmt" "github.com/traefik/yaegi/interp" "github.com/traefik/yaegi/stdlib" ) func main() { i := interp.New(interp.Options{}) i.Use(stdlib.Symbols) // commenting out this line prevents crash syms := i.Symbols("") fmt.Println(syms) }
$ go run ./sample.go // lots of symbols here
$ go run ./sample.go panic: reflect: call of MakeFunc with non-Func type goroutine 1 [running]: reflect.MakeFunc({0x100dfb588, 0x100cfe680}, 0x140003cbe40) /opt/homebrew/Cellar/go/1.22.1/libexec/src/reflect/makefunc.go:48 +0x17c github.com/traefik/yaegi/interp.genFunctionWrapper.func1(0x140000e0420) /Users/oreilly/go/pkg/mod/github.com/traefik/yaegi@v0.16.1/interp/run.go:991 +0xe8 github.com/traefik/yaegi/interp.(*Interpreter).Symbols(0x14000034d88, {0x0, 0x0}) /Users/oreilly/go/pkg/mod/github.com/traefik/yaegi@v0.16.1/interp/use.go:38 +0x408 main.main() /Users/oreilly/tmp/test/sample.go:13 +0x58 exit status 2
v0.16.1
$ go version go version go1.22.1 darwin/arm64
macbook
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
v0.16.1
Additional Notes
$ go version go version go1.22.1 darwin/arm64
macbook