fix: handle empty interface conversion
This commit is contained in:
12
_test/interface42.go
Normal file
12
_test/interface42.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
v := interface{}(0)
|
||||
|
||||
fmt.Println(v)
|
||||
}
|
||||
|
||||
// Output:
|
||||
// 0
|
||||
@@ -383,7 +383,7 @@ func (interp *Interpreter) cfg(root *node, pkgID string) ([]*node, error) {
|
||||
}
|
||||
}
|
||||
|
||||
case arrayType, basicLit, chanType, funcType, mapType, structType:
|
||||
case arrayType, basicLit, chanType, funcType, interfaceType, mapType, structType:
|
||||
n.typ, err = nodeType(interp, sc, n)
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user