]> Cypherpunks repositories - gostls13.git/commit
go/types: fix method set computation if receiver is a named pointer
authorRobert Griesemer <gri@golang.org>
Tue, 6 Jun 2023 20:34:39 +0000 (13:34 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 8 Jun 2023 15:27:57 +0000 (15:27 +0000)
commitfd13444b2b4bf1ce6b05980b1b139402048f0363
treedc67b86802f2f2b8d6a6d17564fce041d8d38f2e
parentb9baf4452fe949a5a159eec4d4a437ad2833ead1
go/types: fix method set computation if receiver is a named pointer

Per the spec, methods cannot be associated with a named pointer type.
Exit early with an empty method set in this case.

This matches the corresponding check in LookupFieldOrMethod;
the check is not present in (lowercase) lookupFieldOrMethod
because it (the check) doesn't apply to struct fields.

Fixes #60634.

Change-Id: Ica6ca8be6b850ea0da6f0b441fbf5b99cb0b6b17
Reviewed-on: https://go-review.googlesource.com/c/go/+/501299
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
src/go/types/methodset.go
src/go/types/methodset_test.go