mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
go.tools/go/types: don't put an interface nil into the Objects map
If a method cannot type check, we end up with the interface variable m to hold <*Func, nil>. Don't put that in the map because it defeats the usual != nil check. R=gri, dsymonds CC=golang-dev https://golang.org/cl/12506043
This commit is contained in:
parent
45e3d57f32
commit
75920173e4
@ -544,11 +544,10 @@ func (check *checker) typeDecl(obj *TypeName, typ ast.Expr, def *Named, cycleOk
|
|||||||
m = nil
|
m = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
check.recordObject(ident, m)
|
|
||||||
|
|
||||||
// If the method is valid, type-check its signature,
|
// If the method is valid, type-check its signature,
|
||||||
// and collect it with the named base type.
|
// and collect it with the named base type.
|
||||||
if m != nil {
|
if m != nil {
|
||||||
|
check.recordObject(ident, m)
|
||||||
check.objDecl(m, nil, true)
|
check.objDecl(m, nil, true)
|
||||||
// Methods with blank _ names cannot be found.
|
// Methods with blank _ names cannot be found.
|
||||||
// Don't add them to the method list.
|
// Don't add them to the method list.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user