Commit graph

4 commits

Author SHA1 Message Date
Robert Griesemer bf9d9b7dba go/types, types2: better error message for some invalid integer array lengths
Don't say "array length must be integer" if it is in fact an integer.

Fixes #59209

Change-Id: If60b93a0418f5837ac334412d3838eec25eeb855
Reviewed-on: https://go-review.googlesource.com/c/go/+/479115
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2023-03-27 18:59:51 +00:00
Dan Scales 29483b3dae test: re-enable a bunch of tests with types2
Enable a bunch of types2-related error tests to run successfully, so
they no longer have to be disabled in run.go.

 - directive.go: split it into directive.go and directive2.go, since the
   possible errors are now split across the parser and noder2, so they
   can't all be reported in one file.

 - linkname2.go: similarly, split it into linkname2.go and linkname3.go
   for the same reason.

 - issue16428.go, issue17645.go, issue47201.dir/bo.go: handle slightly
   different wording by types2

 - issue5609.go: handle slight different error (array length must be
   integer vs. array bound too large).

 - float_lit3.go: handle slightly different wording (overflows
   float vs cannot convert to float)

I purposely didn't try to fix tests yet where there are extra or missing
errors on different lines, since that is not easy to make work for both
-G=3 and -G=0. In a later change, will flip to make the types2 version
match correctly, vs. the -G=0 version.

Change-Id: I6079ff258e3b90146335b9995764e3b1b56cda59
Reviewed-on: https://go-review.googlesource.com/c/go/+/368455
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-12-03 16:24:32 +00:00
Rémy Oudompheng 7a0dc1c9ec test: match gccgo error strings.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/10741043
2013-06-28 23:08:07 +02:00
Daniel Morsing bf9a00bc8f cmd/gc: fix overflow in array bounds calculation.
Fixes #5609.

R=golang-dev, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/9757045
2013-06-01 16:33:54 +02:00