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 I interface { F() } type T struct { Name string } func (t *T) F() { println("in F", t.Name) } func newT(s string) *T { return &T{s} } func NewI(s string) I { return newT(s) } func main() { i := NewI("test") i.F() }
$ go run ./sample.go in F test
$ yaegi ./sample.go ./sample.go:19:2: panic ./sample.go:19:2: panic run: reflect.Set: value of type interp.valueInterface is not assignable to type *struct { Name string } goroutine 1 [running]: runtime/debug.Stack(0x1, 0x14000302a00, 0x40) runtime/debug/stack.go:24 +0x88 github.com/traefik/yaegi/interp.(*Interpreter).eval.func1(0x14000247bf0) github.com/traefik/yaegi/interp/interp.go:503 +0x94 panic(0x100e8df00, 0x14000233350) runtime/panic.go:965 +0x14c github.com/traefik/yaegi/interp.runCfg.func1(0x140001de790, 0x140004d3200, 0x140002479c0) github.com/traefik/yaegi/interp/run.go:185 +0x1e8 panic(0x100e8df00, 0x14000233350) runtime/panic.go:965 +0x14c github.com/traefik/yaegi/interp.runCfg.func1(0x140001de840, 0x140004d2700, 0x14000247780) github.com/traefik/yaegi/interp/run.go:185 +0x1e8 panic(0x100e8df00, 0x14000233350) runtime/panic.go:965 +0x14c reflect.Value.assignTo(0x100f107c0, 0x140001c32e0, 0x99, 0x100caa2df, 0xb, 0x140002f8840, 0x0, 0x140001c32e0, 0xef6ee0d46ab20e00, 0x140001c32e0) reflect/value.go:2451 +0x2d0 reflect.Value.Set(0x140002f8840, 0x140001be968, 0x196, 0x100f107c0, 0x140001c32e0, 0x99) reflect/value.go:1564 +0x94 github.com/traefik/yaegi/interp.call.func3(0x140001de840, 0x140001de8f0, 0x4, 0x140001c0fc0) github.com/traefik/yaegi/interp/run.go:1122 +0x174 github.com/traefik/yaegi/interp.call.func7(0x140001de840, 0x14000233320) github.com/traefik/yaegi/interp/run.go:1200 +0x2a4 github.com/traefik/yaegi/interp.runCfg(0x140004d2700, 0x140001de840) github.com/traefik/yaegi/interp/run.go:191 +0x8c github.com/traefik/yaegi/interp.call.func7(0x140001de790, 0x100f69220) github.com/traefik/yaegi/interp/run.go:1280 +0xa20 github.com/traefik/yaegi/interp.runCfg(0x140004d3200, 0x140001de790) github.com/traefik/yaegi/interp/run.go:191 +0x8c github.com/traefik/yaegi/interp.(*Interpreter).run(0x14000384000, 0x140004d2a00, 0x140001de6e0) github.com/traefik/yaegi/interp/run.go:122 +0x244 github.com/traefik/yaegi/interp.(*Interpreter).eval(0x14000384000, 0x1400018c700, 0xf3, 0x16f9a37d6, 0x1e, 0x0, 0x0, 0x0, 0x0, 0x0, ...) github.com/traefik/yaegi/interp/interp.go:595 +0x5e8 github.com/traefik/yaegi/interp.(*Interpreter).EvalPath(0x14000384000, 0x16f9a37d6, 0x1e, 0x1400018c600, 0xf3, 0x0, 0x0, 0x0) github.com/traefik/yaegi/interp/interp.go:417 +0xc4 main.runFile(0x14000384000, 0x16f9a37d6, 0x1e, 0x0, 0x0, 0x0) github.com/traefik/yaegi/cmd/yaegi/run.go:149 +0x84 main.run(0x140001c2010, 0x1, 0x1, 0x14000182480, 0x14000073ea8) github.com/traefik/yaegi/cmd/yaegi/run.go:112 +0x830 main.main() github.com/traefik/yaegi/cmd/yaegi/yaegi.go:144 +0x324
v0.9.19
related to #1172 (after applying #1174, #1176, #1178)
The text was updated successfully, but these errors were encountered:
interp: fix return of interface value from function call
136f62e
There is no need to wrap the return value of functions returning an interface in a special case, since the refactoring of interfaces. Fixes #1179.
interp: fix handling of interface value in forwarding return calls
64c5587
Special wrapping of interface value at return is no longer necessary and must be avoided now. Fixes #1179.
387bb59
c503855
Successfully merging a pull request may close this issue.
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
v0.9.19
Additional Notes
related to #1172 (after applying #1174, #1176, #1178)
The text was updated successfully, but these errors were encountered: