compiler: extend manifest generation with custom types
This commit is contained in:
parent
cee1836183
commit
25f8545cdf
2 changed files with 41 additions and 0 deletions
|
@ -201,6 +201,21 @@ func (c *codegen) scTypeFromExpr(typ ast.Expr) string {
|
|||
if c.typeOf(typ) == nil {
|
||||
return "Any"
|
||||
}
|
||||
if named, ok := t.(*types.Named); ok {
|
||||
if isInteropPath(named.String()) {
|
||||
name := named.Obj().Name()
|
||||
pkg := named.Obj().Pkg().Name()
|
||||
switch pkg {
|
||||
case "blockchain", "contract":
|
||||
return "Array" // Block, Transaction, Contract
|
||||
case "interop":
|
||||
if name != "Interface" {
|
||||
return name
|
||||
}
|
||||
}
|
||||
return "InteropInterface"
|
||||
}
|
||||
}
|
||||
switch t := t.Underlying().(type) {
|
||||
case *types.Basic:
|
||||
info := t.Info()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue