aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec
diff options
context:
space:
mode:
authorRob Findley <rfindley@google.com>2020-12-08 09:44:48 -0500
committerRobert Findley <rfindley@google.com>2020-12-08 19:45:23 +0000
commit01b76d5fbc4d4acdd28b08a061b072b73b22f44e (patch)
tree01c49c26cbd469a94049eb33818914593b100a04 /src/os/exec
parent48d6275952184f1e858c2796d36c6b205d5d7e83 (diff)
downloadgo-01b76d5fbc4d4acdd28b08a061b072b73b22f44e.tar.xz
go/types: correct error position for inherited const init expressions
This is a port of CL 275517 from the dev.typeparams branch, to fix the positioning of error messages for invalid const init expressions that are inherited. Differences from CL 275517: + The inherited flag is added to the constDecl intermediate representation. + The errpos override is made a positioner, the internal interface used by go/types to capture error position and span. For const decls errpos is just set to a singular point, but using positioner is correct and causes span start and end positions to also be overridden. + Test cases are updated to assert on just 'overflows', as the go/types error message is, for example, "cannot use 255 + iota (untyped int constant 256) as byte value in constant declaration (overflows)". This is more verbose than the compiler's "constant 256 overflows byte", but changing that is out of scope. Fixes #42991 Change-Id: I0a71d2290f7fff5513f2a6e49b83e6f0f4da30e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/276172 Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/os/exec')
0 files changed, 0 insertions, 0 deletions