From: Cuong Manh Le Date: Tue, 7 Jun 2022 02:22:32 +0000 (+0700) Subject: [dev.unified] cmd/compile: set base.Pos when process assignDef in Unified IR X-Git-Tag: go1.20rc1~1807^2~66 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c50c6bbc03;p=gostls13.git [dev.unified] cmd/compile: set base.Pos when process assignDef in Unified IR CL 410343 changes Unified IR to visit LHS before RHS/X in assign/for statement. Thus, it needs to set base.Pos before processing assignee expression, so invalid type can be reported with correct position. Updates #53058 Change-Id: Ic9f60cbf35c8bd71cb391e806396572c37811af7 Reviewed-on: https://go-review.googlesource.com/c/go/+/410794 Reviewed-by: Cherry Mui Run-TryBot: Cuong Manh Le Reviewed-by: Keith Randall Reviewed-by: Keith Randall TryBot-Result: Gopher Robot --- diff --git a/src/cmd/compile/internal/noder/reader.go b/src/cmd/compile/internal/noder/reader.go index d050275f9e..3cd6ec5668 100644 --- a/src/cmd/compile/internal/noder/reader.go +++ b/src/cmd/compile/internal/noder/reader.go @@ -1338,6 +1338,7 @@ func (r *reader) assign() (ir.Node, bool) { case assignDef: pos := r.pos() + setBasePos(pos) _, sym := r.localIdent() typ := r.typ() diff --git a/test/run.go b/test/run.go index 8763660ea8..866654629e 100644 --- a/test/run.go +++ b/test/run.go @@ -1999,7 +1999,6 @@ var unifiedFailures = setOf( "fixedbugs/issue7921.go", // prints "… escapes to heap", but test expects "string(…) escapes to heap" "typeparam/issue47631.go", // unified IR can handle local type declarations - "fixedbugs/issue49767.go", // unified IR reports channel element too large on different line than irgen ) func setOf(keys ...string) map[string]bool {