From 997111ba7d463016c2f44a2740062555951f93fe Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Wed, 3 Jul 2013 14:41:26 -0400 Subject: [PATCH] go.tools/importer: update comment (and absolve gri of blame) for non-bug. R=gri CC=golang-dev https://golang.org/cl/10911044 --- importer/pkginfo.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/importer/pkginfo.go b/importer/pkginfo.go index 335799e03d..12aac26b8f 100644 --- a/importer/pkginfo.go +++ b/importer/pkginfo.go @@ -57,17 +57,11 @@ func (info *PackageInfo) Imports() []*types.Package { // Precondition: e belongs to the package's ASTs. // func (info *PackageInfo) TypeOf(e ast.Expr) types.Type { - // For Ident, b.types may be more specific than - // b.obj(id.(*ast.Ident)).GetType(), - // e.g. in the case of typeswitch. if t, ok := info.types[e]; ok { return t } - // The typechecker doesn't notify us of all Idents, - // e.g. s.Key and s.Value in a RangeStmt. - // So we have this fallback. - // TODO(gri): This is a typechecker bug. When fixed, - // eliminate this case and panic. + // Defining ast.Idents (id := expr) get only Ident callbacks + // but not Expr callbacks. if id, ok := e.(*ast.Ident); ok { return info.ObjectOf(id).Type() }