1
0
mirror of https://github.com/golang/go synced 2024-11-24 00:50:10 -07:00

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 <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: David Chase <drchase@google.com>
This commit is contained in:
Chaoqun Han 2021-11-08 22:58:51 +08:00 committed by David Chase
parent f59d36d2e3
commit d3aedb72c6

View File

@ -160,7 +160,7 @@ func AddImplicitDots(n *ir.SelectorExpr) *ir.SelectorExpr {
case path != nil: case path != nil:
// rebuild elided dots // rebuild elided dots
for c := len(path) - 1; c >= 0; c-- { 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.SetImplicit(true)
dot.SetType(path[c].field.Type) dot.SetType(path[c].field.Type)
n.X = dot n.X = dot