compiler: fix import alias handling
This commit is contained in:
parent
f454112845
commit
8f8c7d2839
3 changed files with 24 additions and 3 deletions
|
@ -1986,7 +1986,11 @@ func (c *codegen) compile(info *buildInfo, pkg *loader.PackageInfo) error {
|
|||
case *ast.FuncDecl:
|
||||
// Don't convert the function if it's not used. This will save a lot
|
||||
// of bytecode space.
|
||||
name := c.getFuncNameFromDecl(pkg.Path(), n)
|
||||
pkgPath := ""
|
||||
if pkg != c.mainPkg.Pkg { // not a main package
|
||||
pkgPath = pkg.Path()
|
||||
}
|
||||
name := c.getFuncNameFromDecl(pkgPath, n)
|
||||
if !isInitFunc(n) && !isDeployFunc(n) && funUsage.funcUsed(name) &&
|
||||
(!isInteropPath(pkg.Path()) && !canInline(pkg.Path())) {
|
||||
c.convertFuncDecl(f, n, pkg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue