Use qualified IDs instead of a usee map

This commit is contained in:
Nigel Tao committed 2017-12-29 14:23:58 +11:00
1 parent 117a6c829b
commit 457235a382
3 files changed
+48 -65

No files matched your search

-8
View File
@@ -155,14 +155,6 @@ func (c *Checker) resolveFunc(typ *a.TypeExpr) (*a.Func, error) {
if f := c.funcs[qqid]; f != nil {
return f, nil
}
// lTyp is from a used package: `use "foo"` followed by `foo.bar`.
u := c.usees[qqid[0]]
if u == nil {
return nil, fmt.Errorf("check: cannot resolve %q in type %q", qqid[0].Str(c.tm), lTyp.Str(c.tm))
}
if f := u.funcs[qqid]; f != nil {
return f, nil
}
}
return nil, fmt.Errorf("check: resolveFunc cannot look up %q", typ.Str(c.tm))
}