traefik / yaegi

Yaegi is Another Elegant Go Interpreter
https://pkg.go.dev/github.com/traefik/yaegi
Apache License 2.0
7.02k stars 349 forks source link

map["key"] syntax issue #1574

Open caiuskong opened 1 year ago

caiuskong commented 1 year ago

The following program sample.go triggers an unexpected result

package main

func main() {
  var m = map[string]interface{}{
    "name": "caius",
  }

  var pp interface{}
  pp = "abc"
  pp, ok := m["pp"]
  fmt.Println(">>pp", pp, ok)  // Result: pp="abc",not nil !!! (In the go interpreter, the result is nil)
}

Expected result

>>pp <nil> false

Got

>>pp abc false

Yaegi Version

0.15.1

Additional Notes

No response