[dev.typeparams] cmd/compile/internal/types2: handle untyped constant arithmetic overflow
Factor out the existing "constant representation" check after untyped constant arithmetic and combine with an overflow check. Use a better heuristic for determining the error position if we know the error is for a constant operand that is the result of an arithmetic expression. Related cleanups. With this change, untyped constant arithmetic reports an error when (integer) constants become too large (> 2048 bits). Before, such arithmetic was only limited by space and time. Change-Id: Id3cea66c8ba697ff4c7fd1e848f350d9713e3c75 Reviewed-on: https://go-review.googlesource.com/c/go/+/287832 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by:Robert Findley <rfindley@google.com>
Loading
Please sign in to comment