compiler: allow to inline global variables
This commit is contained in:
parent
6e560c6c9f
commit
cf459002f7
3 changed files with 36 additions and 0 deletions
|
@ -53,6 +53,10 @@ func (c *codegen) inlineCall(f *funcScope, n *ast.CallExpr) {
|
|||
c.scope.vars.locals = newScope
|
||||
c.scope.vars.addAlias(name, varLocal, unspecifiedVarIndex, types.TypeAndValue{})
|
||||
continue
|
||||
} else if index, ok := c.globals[c.getIdentName("", arg.Name)]; ok {
|
||||
c.scope.vars.locals = newScope
|
||||
c.scope.vars.addAlias(name, varGlobal, index, types.TypeAndValue{})
|
||||
continue
|
||||
}
|
||||
}
|
||||
ast.Walk(c, n.Args[i])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue