From 6d8ba77896d05720e1cb1728c27db60926e672b5 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 13 Apr 2021 16:31:56 -0700 Subject: cmd/compile: fix importing of method expressions For OMETHEXPR, the Name in the Selection needs to be properly linked up to the method declaration. Use the same code we already have for ODOTMETH and OCALLPART to do that. Fixes #45503 Change-Id: I7d6f886d606bae6faad8c104f50c177f871d41c8 Reviewed-on: https://go-review.googlesource.com/c/go/+/309831 Trust: Keith Randall Run-TryBot: Keith Randall TryBot-Result: Go Bot Reviewed-by: Cuong Manh Le Reviewed-by: Dan Scales --- src/cmd/compile/internal/typecheck/iexport.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/cmd/compile/internal/typecheck/iexport.go') diff --git a/src/cmd/compile/internal/typecheck/iexport.go b/src/cmd/compile/internal/typecheck/iexport.go index 8f8931e495..911d758083 100644 --- a/src/cmd/compile/internal/typecheck/iexport.go +++ b/src/cmd/compile/internal/typecheck/iexport.go @@ -1591,17 +1591,10 @@ func (w *exportWriter) expr(n ir.Node) { w.exoticSelector(n.Sel) if go117ExportTypes { w.exoticType(n.Type()) - if n.Op() == ir.ODOT || n.Op() == ir.ODOTPTR || n.Op() == ir.ODOTINTER || n.Op() == ir.OMETHEXPR { + if n.Op() == ir.ODOT || n.Op() == ir.ODOTPTR || n.Op() == ir.ODOTINTER { w.exoticParam(n.Selection) - if n.Op() == ir.OMETHEXPR { - name := ir.MethodExprName(n) - w.bool(name != nil) - if name != nil { - w.exoticType(name.Type()) - } - } } - // n.Selection is not required for ODOTMETH and OCALLPART. It will + // n.Selection is not required for OMETHEXPR, ODOTMETH, and OCALLPART. It will // be reconstructed during import. } -- cgit v1.2.3-54-g00ecf