aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/lookup.go
diff options
context:
space:
mode:
authorRob Findley <rfindley@google.com>2021-08-03 20:36:02 -0400
committerRobert Findley <rfindley@google.com>2021-08-04 11:07:03 +0000
commit880ab6209e618c7dd6e47fa07e66176cd801eba1 (patch)
treee90505fb2eadcb49adb84fe14d477fc2cc578dfe /src/cmd/compile/internal/types2/lookup.go
parent5b51cf47dcf08d86eb1de22850ebd7d75e7a02af (diff)
downloadgo-880ab6209e618c7dd6e47fa07e66176cd801eba1.tar.gz
go-880ab6209e618c7dd6e47fa07e66176cd801eba1.zip
[dev.typeparams] cmd/compile/internal/types2: fix a panic in missingMethod
When static == false, missingMethod incorrectly continues with a nil Func. Also remove some unnecessary type names from typeterm_test.go, which was done in the go/types port. Change-Id: I21fa637ac82b115563d3601314a470a5a43f9ae0 Reviewed-on: https://go-review.googlesource.com/c/go/+/339672 Trust: Robert Findley <rfindley@google.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/types2/lookup.go')
-rw-r--r--src/cmd/compile/internal/types2/lookup.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/lookup.go b/src/cmd/compile/internal/types2/lookup.go
index 41e5bc7811..f62c3771d2 100644
--- a/src/cmd/compile/internal/types2/lookup.go
+++ b/src/cmd/compile/internal/types2/lookup.go
@@ -308,7 +308,10 @@ func (check *Checker) missingMethod(V Type, T *Interface, static bool) (method,
for _, m := range T.typeSet().methods {
_, f := ityp.typeSet().LookupMethod(m.pkg, m.name)
- if f == nil && static {
+ if f == nil {
+ if !static {
+ continue
+ }
return m, f
}