compiler: save both VM and smartcontract types
VM types are used in debugger, while smartcontract ones are used in manifest. We can't save only one of them, because conversion in either side is lossy: 1. VM has `Array` and `Struct` but smartcontract only has `Array`. 2. Smartcontract has `Hash160` etc, which are all `ByteString` or `Buffer` in VM. And to spice things a bit more, return type in debugger can be `Void`, which corresponds to no real stackitem type (as it must exist).
This commit is contained in:
parent
3d0ed6eac3
commit
cbf26f315c
5 changed files with 140 additions and 67 deletions
|
@ -877,7 +877,8 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor {
|
|||
tv := c.typeAndValueOf(n.Args[0])
|
||||
params := make([]string, 0, len(n.Args[1:]))
|
||||
for _, p := range n.Args[1:] {
|
||||
params = append(params, c.scTypeFromExpr(p))
|
||||
st, _ := c.scAndVMTypeFromExpr(p)
|
||||
params = append(params, st.String())
|
||||
}
|
||||
// Sometimes event name is stored in a var.
|
||||
// Skip in this case.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue