diff options
author | Robert Griesemer <gri@golang.org> | 2020-11-19 17:49:05 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2020-11-20 02:39:33 +0000 |
commit | 8fbdacf64c982b9a7f8cb27754bb01cedffa53c7 (patch) | |
tree | bd081b1462580df8e41b37b00187531a3575262a /src/cmd/compile/internal/types2/stmt.go | |
parent | b1ae0a0646d062559249675e6bf6883b44094046 (diff) | |
download | go-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.go | 2 |
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 } |