compiler: support basic inlining

This commit is contained in:
Evgeniy Stratonikov 2021-02-04 15:41:00 +03:00
parent 1f238ce6fd
commit 1ae0d022dd
9 changed files with 258 additions and 4 deletions

View file

@ -8,6 +8,11 @@ import (
)
func (c *codegen) typeAndValueOf(e ast.Expr) types.TypeAndValue {
for i := len(c.pkgInfoInline) - 1; i >= 0; i-- {
if tv, ok := c.pkgInfoInline[i].Types[e]; ok {
return tv
}
}
return c.typeInfo.Types[e]
}