mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
compiler: do not convert interop types on assertion
This commit is contained in:
parent
2f6345f2d9
commit
73a75cc27a
2 changed files with 14 additions and 2 deletions
|
@ -1197,8 +1197,11 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor {
|
|||
// not the assertion type.
|
||||
case *ast.TypeAssertExpr:
|
||||
ast.Walk(c, n.X)
|
||||
typ := toNeoType(c.typeOf(n.Type))
|
||||
emit.Instruction(c.prog.BinWriter, opcode.CONVERT, []byte{byte(typ)})
|
||||
goTyp := c.typeOf(n.Type)
|
||||
if canConvert(goTyp.String()) {
|
||||
typ := toNeoType(goTyp)
|
||||
emit.Instruction(c.prog.BinWriter, opcode.CONVERT, []byte{byte(typ)})
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue