-
Notifications
You must be signed in to change notification settings - Fork 401
Open
Description
The following program sample.go triggers an unexpected result
package main
func main() {
for range 0 {
}
}Expected result
(no output)Got
scope.go:207: nil type
panic: nil type
goroutine 1 [running]:
log.Panic({0x14000493278?, 0x140004164e0?, 0x14000493288?})
/opt/homebrew/Cellar/go/1.22.3/libexec/src/log/log.go:432 +0x60
github.com/traefik/yaegi/interp.(*scope).add(0x140000ee3f0, 0x0)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/scope.go:207 +0x50
github.com/traefik/yaegi/interp.(*Interpreter).cfg.func1(0x1400041c8c0)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/cfg.go:202 +0x3f74
github.com/traefik/yaegi/interp.(*node).Walk(0x1400041c8c0, 0x14000493960, 0x14000493908)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/interp.go:282 +0x34
github.com/traefik/yaegi/interp.(*node).Walk(0x1400041c500, 0x14000493960, 0x14000493908)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/interp.go:286 +0x74
github.com/traefik/yaegi/interp.(*node).Walk(0x1400041c3c0, 0x14000493960, 0x14000493908)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/interp.go:286 +0x74
github.com/traefik/yaegi/interp.(*node).Walk(0x1400041c280, 0x14000493960, 0x14000493908)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/interp.go:286 +0x74
github.com/traefik/yaegi/interp.(*node).Walk(0x14000419a40, 0x14000493960, 0x14000493908)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/interp.go:286 +0x74
github.com/traefik/yaegi/interp.(*node).Walk(0x140004197c0, 0x14000493960, 0x14000493908)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/interp.go:286 +0x74
github.com/traefik/yaegi/interp.(*Interpreter).cfg(0x140000f26c8, 0x140004197c0, 0x140000ee3f0, {0x1400036f978, 0x4}, {0x1400036f978, 0x4})
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/cfg.go:69 +0x198
github.com/traefik/yaegi/interp.(*Interpreter).CompileAST(0x140000f26c8, {0x101b69ea0?, 0x140001be8c0?})
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/program.go:97 +0x114
github.com/traefik/yaegi/interp.(*Interpreter).compileSrc(0x140000f26c8, {0x14000040600?, 0x30?}, {0x16ee992ad?, 0x14000597700?}, 0x0?)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/program.go:64 +0xb8
github.com/traefik/yaegi/interp.(*Interpreter).eval(0x140000f26c8, {0x14000040600?, 0x30?}, {0x16ee992ad?, 0x14000597700?}, 0xd0?)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/interp.go:554 +0x28
github.com/traefik/yaegi/interp.(*Interpreter).EvalPath(0x140000f26c8, {0x16ee992ad, 0x9})
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/interp/interp.go:512 +0xa4
main.runFile(0x140000f26c8, {0x16ee992ad, 0x9}, 0x0)
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/cmd/yaegi/run.go:153 +0xe8
main.run({0x14000148010, 0x1, 0x1})
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/cmd/yaegi/run.go:116 +0xae4
main.main()
/Users/user/go/pkg/mod/github.com/traefik/[email protected]/cmd/yaegi/yaegi.go:144 +0x308Yaegi Version
Additional Notes
No response
carbap
Metadata
Metadata
Assignees
Labels
No labels