mirror of
https://github.com/golang/go
synced 2024-11-26 20:11:26 -07:00
go/types: minor refactoring of missingMethod following CL 494615
Make the refactoring suggested by gri@ in that CL. Change-Id: I6c363f3ba5aaa3c616d3982d998b989de7046a86 Reviewed-on: https://go-review.googlesource.com/c/go/+/494617 Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
803a7dfb80
commit
cecf8b9328
@ -387,10 +387,6 @@ func (check *Checker) missingMethod(V, T Type, static bool, equivalent func(x, y
|
||||
obj, _, _ = lookupFieldOrMethodImpl(V, false, m.pkg, m.name, true /* fold case */)
|
||||
f, _ = obj.(*Func)
|
||||
if f != nil {
|
||||
// This method is formatted in funcString below, so must be type-checked.
|
||||
if check != nil {
|
||||
check.objDecl(f, nil)
|
||||
}
|
||||
state = wrongName
|
||||
}
|
||||
}
|
||||
@ -421,6 +417,13 @@ func (check *Checker) missingMethod(V, T Type, static bool, equivalent func(x, y
|
||||
}
|
||||
|
||||
if cause != nil {
|
||||
if f != nil {
|
||||
// This method may be formatted in funcString below, so must have a fully
|
||||
// set up signature.
|
||||
if check != nil {
|
||||
check.objDecl(f, nil)
|
||||
}
|
||||
}
|
||||
switch state {
|
||||
case notFound:
|
||||
switch {
|
||||
|
@ -389,10 +389,6 @@ func (check *Checker) missingMethod(V, T Type, static bool, equivalent func(x, y
|
||||
obj, _, _ = lookupFieldOrMethodImpl(V, false, m.pkg, m.name, true /* fold case */)
|
||||
f, _ = obj.(*Func)
|
||||
if f != nil {
|
||||
// This method is formatted in funcString below, so must be type-checked.
|
||||
if check != nil {
|
||||
check.objDecl(f, nil)
|
||||
}
|
||||
state = wrongName
|
||||
}
|
||||
}
|
||||
@ -423,6 +419,13 @@ func (check *Checker) missingMethod(V, T Type, static bool, equivalent func(x, y
|
||||
}
|
||||
|
||||
if cause != nil {
|
||||
if f != nil {
|
||||
// This method may be formatted in funcString below, so must have a fully
|
||||
// set up signature.
|
||||
if check != nil {
|
||||
check.objDecl(f, nil)
|
||||
}
|
||||
}
|
||||
switch state {
|
||||
case notFound:
|
||||
switch {
|
||||
|
Loading…
Reference in New Issue
Block a user