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 import "sample/d2" // see below for d2 definition func main() { f := d2.F f() }
$ GO111MODULE=off go run ./sample.go test
$ yaegi ./sample.go /Users/marc/go/src/sample/d1/d1.go:7:27: panic sample.go:7:2: panic run: reflect: call of reflect.Value.Field on zero Value goroutine 1 [running]: runtime/debug.Stack(0x1, 0x140002f8e00, 0x40) runtime/debug/stack.go:24 +0x88 github.com/traefik/yaegi/interp.(*Interpreter).eval.func1(0x140004cfbf0) github.com/traefik/yaegi/interp/interp.go:503 +0x94 panic(0x1036a0f60, 0x140001a2e70) runtime/panic.go:965 +0x14c github.com/traefik/yaegi/interp.runCfg.func1(0x140001d6b00, 0x140001cf100, 0x140004cf9c0) github.com/traefik/yaegi/interp/run.go:185 +0x1e8 panic(0x1036a0f60, 0x140001a2e70) runtime/panic.go:965 +0x14c github.com/traefik/yaegi/interp.runCfg.func1(0x140001d6bb0, 0x140004c6000, 0x140004cf780) github.com/traefik/yaegi/interp/run.go:185 +0x1e8 panic(0x1036a0f60, 0x140001a2e70) runtime/panic.go:965 +0x14c reflect.Value.Field(0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x140004cf748) reflect/value.go:850 +0x11c reflect.Value.FieldByIndex(0x0, 0x0, 0x0, 0x140003769f0, 0x1, 0x1, 0x10, 0x103f10a68, 0x10) reflect/value.go:882 +0x1f0 github.com/traefik/yaegi/interp.getPtrIndexSeq.func3(0x140001d6bb0, 0x10366df00) github.com/traefik/yaegi/interp/run.go:1917 +0xd0 github.com/traefik/yaegi/interp.runCfg(0x140004c6000, 0x140001d6bb0) github.com/traefik/yaegi/interp/run.go:191 +0x8c github.com/traefik/yaegi/interp.call.func7(0x140001d6b00, 0x14000253f10) github.com/traefik/yaegi/interp/run.go:1280 +0xa20 github.com/traefik/yaegi/interp.runCfg(0x140001cf100, 0x140001d6b00) github.com/traefik/yaegi/interp/run.go:191 +0x8c github.com/traefik/yaegi/interp.(*Interpreter).run(0x1400037a000, 0x140001ce900, 0x140001d68f0) github.com/traefik/yaegi/interp/run.go:122 +0x244 github.com/traefik/yaegi/interp.(*Interpreter).eval(0x1400037a000, 0x140001838c0, 0x5a, 0x16d1c37fe, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, ...) github.com/traefik/yaegi/interp/interp.go:595 +0x5e8 github.com/traefik/yaegi/interp.(*Interpreter).EvalPath(0x1400037a000, 0x16d1c37fe, 0xb, 0x14000183800, 0x5a, 0x0, 0x0, 0x0) github.com/traefik/yaegi/interp/interp.go:417 +0xc4 main.runFile(0x1400037a000, 0x16d1c37fe, 0xb, 0x0, 0x0, 0x0) github.com/traefik/yaegi/cmd/yaegi/run.go:149 +0x84 main.run(0x140001ba010, 0x1, 0x1, 0x14000186180, 0x14000073ea8) github.com/traefik/yaegi/cmd/yaegi/run.go:112 +0x830 main.main() github.com/traefik/yaegi/cmd/yaegi/yaegi.go:144 +0x324
78d7e85 (master at July 12th 2021)
With the following packages ~/go/src/sample/d2/d2.go:
~/go/src/sample/d2/d2.go
package d2 import "sample/d1" var ( x := d1.NewT("test") F := x.F )
and ~/go/src/sample/d1/d1.go:
~/go/src/sample/d1/d1.go
package d1 type T struct { Name string } func (t *T)F { println(t.Name) } func NewT(s string) *T { return &T{s} }
This issue is related to #1172.
The text was updated successfully, but these errors were encountered:
interp: fix receiver for exported method objects
9356fab
When a function variable is assigned from an exported method, make sure the receiver is updated from the coresponding symbol. Fixes #1182.
4486c57
13d554a
Successfully merging a pull request may close this issue.
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
78d7e85 (master at July 12th 2021)
Additional Notes
With the following packages
~/go/src/sample/d2/d2.go
:and
~/go/src/sample/d1/d1.go
:This issue is related to #1172.
The text was updated successfully, but these errors were encountered: