]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: fix MethodExpr handling with embedded fields
authorDan Scales <danscales@google.com>
Sun, 24 Jan 2021 17:59:20 +0000 (09:59 -0800)
committerDan Scales <danscales@google.com>
Tue, 26 Jan 2021 17:05:06 +0000 (17:05 +0000)
commit08a598f8c1c123fda3b7ad30659fa05a8be1ccde
treebab7a41df3b1819b7c0bd19900607247d01ed0ff
parentcecc1dfcba15a06a06a7f3ea79e809e95c166c25
[dev.typeparams] cmd/compile: fix MethodExpr handling with embedded fields

The recent refactoring of SelectorExpr code to helpers broke the
handling of MethodExprs when there is an embedded field involved (e.g.
test/method7.go, line 48). If there is an embedded field involved, the
node op seen in DotMethod() is an ODOT rather than an OTYPE. Also, the
receiver type of the result should be the original type, but the new
code was using the last type after following the embedding path.

Change-Id: I13f7ea6448b03d3e8f974103ee3a027219ca8388
Reviewed-on: https://go-review.googlesource.com/c/go/+/286176
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/noder/expr.go
src/cmd/compile/internal/noder/helpers.go
src/reflect/all_test.go
test/method7.go