compiler: make interface{}() conversions possible

This commit is contained in:
Roman Khimov 2022-07-06 18:04:25 +03:00
parent ec3d1fae59
commit 6deb77a77a
3 changed files with 18 additions and 0 deletions

View file

@ -944,6 +944,11 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor {
ast.Walk(c, n.Args[0])
c.emitConvert(stackitem.BufferT)
return nil
case *ast.InterfaceType:
// It's a type conversion into some interface. Programmer is responsible
// for the conversion to be appropriate, just load the arg.
ast.Walk(c, n.Args[0])
return nil
case *ast.FuncLit:
isLiteral = true
}