-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implicity is ignored #919
Comments
As of 0.9.5: $ yaegi ./sample.go
false
./sample.go:27:2: panic
run: reflect: call of reflect.Value.Elem on struct Value
goroutine 1 [running]:
runtime/debug.Stack(0x1, 0xc000188a00, 0x40)
/usr/lib/go/src/runtime/debug/stack.go:24 +0x9f
github.com/traefik/yaegi/interp.(*Interpreter).eval.func1(0xc000239c70)
/home/mendel/go/pkg/mod/github.com/traefik/yaegi@v0.9.5/interp/interp.go:480 +0xc5
panic(0xe02c00, 0xc000482ba0)
/usr/lib/go/src/runtime/panic.go:969 +0x1b9
github.com/traefik/yaegi/interp.runCfg.func1(0xc0001d0820, 0xc000488300, 0xc000239a60)
/home/mendel/go/pkg/mod/github.com/traefik/yaegi@v0.9.5/interp/run.go:171 +0x247
panic(0xe02c00, 0xc000482ba0)
/usr/lib/go/src/runtime/panic.go:969 +0x1b9
reflect.Value.Elem(0xe50d20, 0xc000482b60, 0x199, 0x199, 0x0, 0x0)
/usr/lib/go/src/reflect/value.go:842 +0x1a5
github.com/traefik/yaegi/interp.typeAssert.func2(0xc0001d0820, 0xc000482800)
/home/mendel/go/pkg/mod/github.com/traefik/yaegi@v0.9.5/interp/run.go:244 +0x78
github.com/traefik/yaegi/interp.runCfg(0xc000488300, 0xc0001d0820)
/home/mendel/go/pkg/mod/github.com/traefik/yaegi@v0.9.5/interp/run.go:177 +0x87
github.com/traefik/yaegi/interp.(*Interpreter).run(0xc0003ae000, 0xc000487c00, 0xc0001d0780)
/home/mendel/go/pkg/mod/github.com/traefik/yaegi@v0.9.5/interp/run.go:108 +0x2af
github.com/traefik/yaegi/interp.(*Interpreter).eval(0xc0003ae000, 0xc000176700, 0x1a1, 0x7ffcfa41a6c7, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/mendel/go/pkg/mod/github.com/traefik/yaegi@v0.9.5/interp/interp.go:572 +0x809
github.com/traefik/yaegi/interp.(*Interpreter).EvalPath(0xc0003ae000, 0x7ffcfa41a6c7, 0x8, 0xc000176500, 0x1a1, 0x0, 0x0, 0xc0003f60d0)
/home/mendel/go/pkg/mod/github.com/traefik/yaegi@v0.9.5/interp/interp.go:394 +0xfa
main.runFile(0xc0003ae000, 0x7ffcfa41a6c7, 0x8, 0xc000138cc0, 0x1)
/home/mendel/go/pkg/mod/github.com/traefik/yaegi@v0.9.5/cmd/yaegi/run.go:123 +0xae
main.run(0xc000128030, 0x1, 0x1, 0x13, 0x13)
/home/mendel/go/pkg/mod/github.com/traefik/yaegi@v0.9.5/cmd/yaegi/run.go:89 +0x7e5
main.main()
/home/mendel/go/pkg/mod/github.com/traefik/yaegi@v0.9.5/cmd/yaegi/yaegi.go:144 +0x415 |
mpl
added a commit
to mpl/yaegi
that referenced
this issue
Dec 1, 2020
The long-form (with comma-ok) ones were already fixed but the short-form ones were not because they were in a completely different code path. This PR also refactors the code so that both short-form and long-form are now merged in the same function. N.B: even though most (all?) cases seem to now be supported, one of them still yields a result that does not satisfy reflect's Implements method yet. It does not prevent the resulting assertion to be usable though. N.B2: the code path for the third-form (_, ok) hasn't been fixed and/or refactored yet. Fixes traefik#919
traefiker
pushed a commit
that referenced
this issue
Dec 2, 2020
The long-form (with comma-ok) ones were already fixed but the short-form ones were not because they were in a completely different code path. This PR also refactors the code so that both short-form and long-form are now merged in the same function. N.B: even though most (all?) cases seem to now be supported, one of them still yields a result that does not satisfy reflect's Implements method yet. It does not prevent the resulting assertion to be usable though. N.B2: the code path for the third-form (_, ok) hasn't been fixed and/or refactored yet. Fixes #919
It should be noted that the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following program
sample.go
triggers a panic:Expected result:
Got:
The text was updated successfully, but these errors were encountered: