From d3aedb72c687cc58e10755eff006a4dd45cb8e15 Mon Sep 17 00:00:00 2001 From: Chaoqun Han Date: Mon, 8 Nov 2021 22:58:51 +0800 Subject: [PATCH] cmd/compile: NewSelectorExpr use n.Pos instead of base.Pos Fixes #49436 Change-Id: I4c8851e7aaee631d5eb22f2ef0aea5a25e936d87 Reviewed-on: https://go-review.googlesource.com/c/go/+/361917 Run-TryBot: Dan Scales TryBot-Result: Go Bot Reviewed-by: Keith Randall Trust: David Chase --- src/cmd/compile/internal/typecheck/subr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/typecheck/subr.go b/src/cmd/compile/internal/typecheck/subr.go index 1986845f64..5b5b043715 100644 --- a/src/cmd/compile/internal/typecheck/subr.go +++ b/src/cmd/compile/internal/typecheck/subr.go @@ -160,7 +160,7 @@ func AddImplicitDots(n *ir.SelectorExpr) *ir.SelectorExpr { case path != nil: // rebuild elided dots for c := len(path) - 1; c >= 0; c-- { - dot := ir.NewSelectorExpr(base.Pos, ir.ODOT, n.X, path[c].field.Sym) + dot := ir.NewSelectorExpr(n.Pos(), ir.ODOT, n.X, path[c].field.Sym) dot.SetImplicit(true) dot.SetType(path[c].field.Type) n.X = dot -- 2.50.0