Skip to content

Commit

Permalink
Use qualified names
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Sep 20, 2023
1 parent 0875412 commit fb9a058
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
16 changes: 8 additions & 8 deletions compiler/testdata/coroutine_durable.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion compiler/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ func typeExpr(typ types.Type) ast.Expr {
if t.TypeParams() != nil || t.TypeArgs() != nil {
panic("not implemented: generic types")
}
return ast.NewIdent(t.Obj().Name())
obj := t.Obj()
name := ast.NewIdent(obj.Name())
pkg := obj.Pkg()
if pkg == nil {
return name
}
// TODO: this needs to be incorporated in the pass to find imports
return &ast.SelectorExpr{X: ast.NewIdent(pkg.Name()), Sel: name}
case *types.Chan:
t.Dir()
c := &ast.ChanType{
Expand Down

0 comments on commit fb9a058

Please sign in to comment.