Skip to content

Commit

Permalink
interp: fix package lookup for type analysis of local types
Browse files Browse the repository at this point in the history
Fixes #1203.
  • Loading branch information
kortschak authored Aug 2, 2021
1 parent 32ff3fb commit d4e25f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions interp/gta.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package interp

import (
"path"
"path/filepath"
"reflect"
)
Expand Down Expand Up @@ -187,6 +188,9 @@ func (interp *Interpreter) gta(root *node, rpath, importPath string) ([]*node, e
}
// Try to import a binary package first, or a source package
var pkgName string
if packageName := path.Base(ipath); path.Dir(ipath) == packageName {
ipath = packageName
}
if pkg := interp.binPkg[ipath]; pkg != nil {
switch name {
case "_": // no import of symbols
Expand Down

0 comments on commit d4e25f0

Please sign in to comment.