]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.20] cmd/compile: relax overly strict assertion
authorMatthew Dempsky <mdempsky@google.com>
Tue, 21 Feb 2023 21:16:22 +0000 (13:16 -0800)
committerGopher Robot <gobot@golang.org>
Wed, 1 Mar 2023 22:03:12 +0000 (22:03 +0000)
commit26eeaec89c1e78696bfa8ad000d4c8275e3bdb75
treea17536c4b16797cd6b2cf233e4ad4877ad16ba9c
parent9629fa1874f269cdc488081912afb45a7b34da86
[release-branch.go1.20] cmd/compile: relax overly strict assertion

The assertion here was to make sure the newly constructed and
typechecked expression selected the same receiver-qualified method,
but in the case of anonymous receiver types we can actually end up
with separate types.Field instances corresponding to each types.Type
instance. In that case, the assertion spuriously failed.

The fix here is to relax and assertion and just compare the method's
name and type (including receiver type).

Fixes #58776.

Change-Id: I67d51ddb020e6ed52671473c93fc08f283a40886
Reviewed-on: https://go-review.googlesource.com/c/go/+/471676
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit 37a2004b431df6cdd3260cbfe2ddb7673e94b9ef)
Reviewed-on: https://go-review.googlesource.com/c/go/+/472620
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/compile/internal/noder/reader.go
test/fixedbugs/issue58563.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue58563.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue58563.go [new file with mode: 0644]