aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/stmt.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2020-11-19 17:49:05 -0800
committerRobert Griesemer <gri@golang.org>2020-11-20 02:39:33 +0000
commit8fbdacf64c982b9a7f8cb27754bb01cedffa53c7 (patch)
treebd081b1462580df8e41b37b00187531a3575262a /src/cmd/compile/internal/types2/stmt.go
parentb1ae0a0646d062559249675e6bf6883b44094046 (diff)
downloadgo-8fbdacf64c982b9a7f8cb27754bb01cedffa53c7.tar.gz
go-8fbdacf64c982b9a7f8cb27754bb01cedffa53c7.zip
[dev.typeparams] cmd/compile/internal/types2: report constant overflow in binary ops
This is the go.types changes of https://golang.org/cl/271706 ported to types2. Also: Fixed a bug in the go/types version (was using the wrong position in the error message). Change-Id: I798b80243a66f0be5b943a6951d7a1ff769abca2 Reviewed-on: https://go-review.googlesource.com/c/go/+/271806 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/stmt.go')
-rw-r--r--src/cmd/compile/internal/types2/stmt.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/stmt.go b/src/cmd/compile/internal/types2/stmt.go
index 2f1347faf4..d88f65b15e 100644
--- a/src/cmd/compile/internal/types2/stmt.go
+++ b/src/cmd/compile/internal/types2/stmt.go
@@ -396,7 +396,7 @@ func (check *Checker) stmt(ctxt stmtContext, s syntax.Stmt) {
}
var x operand
- check.binary(&x, nil, lhs[0], rhs[0], s.Op)
+ check.binary(&x, nil, lhs[0], rhs[0], s.Op, rhs[0].Pos()) // TODO(gri) should have TokPos here (like in go/types)
if x.mode == invalid {
return
}