traefik / yaegi

Yaegi is Another Elegant Go Interpreter

Home Page:https://pkg.go.dev/github.com/traefik/yaegi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

typeswitch of an expression

mvertes opened this issue · comments

The following program sample.go triggers an unexpected result

package main

func f(params ...interface{}) {
    switch p0 := params[0].(type) {
    case string:
        println("string:", p0)
    default:
        println("not a string")
    }   
}   
    
func main() {
    f("Hello")
}

Expected result

$ go run ./sample.go
Hello

Got

$ yaegi ./sample.go
not a string

Yaegi Version

v0.14.1

Additional Notes

This issue is related to #1426.