Open he11olx opened 1 year ago
test case:
func main() { script1 := `package script import "encoding/json" var _ = json.Marshal ` script2 := `package script import "encoding/json" var _ = json.Marshal ` inter := interp.New(interp.Options{GoPath: build.Default.GOPATH}) _ = inter.Use(stdlib.Symbols) inter.Eval(script1) _, err := inter.Eval(script2) fmt.Println(err) // 2:8: json/_.go redeclared in this block }
Related to: https://github.com/traefik/yaegi/pull/1066/files
All committers have signed the CLA.
Looks like not a bug but a feature. But In REPL, executing two import "fmt" will also report errors.
import "fmt"
➜ yaegi > import "fmt" : 0x14000030120 > import "fmt" 1:21: fmt/_.go redeclared in this block
test case:
Related to: https://github.com/traefik/yaegi/pull/1066/files