We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
sample.go
package main type Core interface { Enabler } type Enabler interface { Enabled() bool } type Logger struct { core Core } func (log *Logger) GetCore() Core { return log.core } type T struct{} func (t *T) Enabled() bool { return true } func main() { base := &Logger{&T{}} println(base.GetCore().Enabled()) }
$ go run ./sample.go true
$ yaegi ./sample.go ./sample.go:23:10: panic run: runtime error: invalid memory address or nil pointer dereference goroutine 1 [running]: runtime/debug.Stack(0x1, 0x14000090400, 0x40) /Users/marc/sdk/go1.16.6/src/runtime/debug/stack.go:24 +0x88 github.com/traefik/yaegi/interp.(*Interpreter).eval.func1(0x140000a5bf0) /Users/marc/go/src/github.com/traefik/yaegi2/interp/interp.go:504 +0x94 panic(0x104adcf20, 0x10506eae0) /Users/marc/sdk/go1.16.6/src/runtime/panic.go:965 +0x14c github.com/traefik/yaegi/interp.runCfg.func1(0x1400036e160, 0x14000095100, 0x140000a59c0) /Users/marc/go/src/github.com/traefik/yaegi2/interp/run.go:185 +0x1e8 panic(0x104adcf20, 0x10506eae0) /Users/marc/sdk/go1.16.6/src/runtime/panic.go:965 +0x14c github.com/traefik/yaegi/interp.getMethodByName.func1(0x1400036e160, 0x1400011ab40) /Users/marc/go/src/github.com/traefik/yaegi2/interp/run.go:1845 +0x174 github.com/traefik/yaegi/interp.runCfg(0x14000095100, 0x1400036e160) /Users/marc/go/src/github.com/traefik/yaegi2/interp/run.go:191 +0x8c github.com/traefik/yaegi/interp.(*Interpreter).run(0x1400036c000, 0x14000094500, 0x1400036e000) /Users/marc/go/src/github.com/traefik/yaegi2/interp/run.go:122 +0x244 github.com/traefik/yaegi/interp.(*Interpreter).eval(0x1400036c000, 0x140001c69a0, 0x151, 0x16bd9b798, 0x1e, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /Users/marc/go/src/github.com/traefik/yaegi2/interp/interp.go:596 +0x5e8 github.com/traefik/yaegi/interp.(*Interpreter).EvalPath(0x1400036c000, 0x16bd9b798, 0x1e, 0x140001c6800, 0x151, 0x0, 0x0, 0x0) /Users/marc/go/src/github.com/traefik/yaegi2/interp/interp.go:418 +0xc4 main.runFile(0x1400036c000, 0x16bd9b798, 0x1e, 0x0, 0x0, 0x0) /Users/marc/go/src/github.com/traefik/yaegi2/cmd/yaegi/run.go:149 +0x84 main.run(0x140001c0010, 0x1, 0x1, 0x14000182480, 0x14000073ea8) /Users/marc/go/src/github.com/traefik/yaegi2/cmd/yaegi/run.go:112 +0x830 main.main() /Users/marc/go/src/github.com/traefik/yaegi2/cmd/yaegi/yaegi.go:144 +0x324
0.9.21
No response
The text was updated successfully, but these errors were encountered:
issue related to #1172, after #1207 is applied.
Sorry, something went wrong.
interp: improve handling of interface struct field
c6dc95e
Wrap non empty interface value in struct field, to allow method lookup. Fixes #1208.
3bf4b41
37fe342
Successfully merging a pull request may close this issue.
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
0.9.21
Additional Notes
No response
The text was updated successfully, but these errors were encountered: