internal/refactor/inline: audit for types.Alias safety
Updates golang/go#65294
Change-Id: I14f7d06a0e41799238707b20a88205ae1bfc1ce8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/562036
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
diff --git a/internal/refactor/inline/escape.go b/internal/refactor/inline/escape.go
index 795ad4f..a3f5e55 100644
--- a/internal/refactor/inline/escape.go
+++ b/internal/refactor/inline/escape.go
@@ -72,7 +72,7 @@
if sel, ok := n.Fun.(*ast.SelectorExpr); ok {
if seln, ok := info.Selections[sel]; ok &&
seln.Kind() == types.MethodVal &&
- isPointer(seln.Obj().Type().(*types.Signature).Recv().Type()) {
+ isPointer(seln.Obj().Type().Underlying().(*types.Signature).Recv().Type()) {
tArg, indirect := effectiveReceiver(seln)
if !indirect && !isPointer(tArg) {
lvalue(sel.X, true) // &x.f