]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: better error message for invalid array length
authorRobert Griesemer <gri@golang.org>
Fri, 11 Feb 2022 21:16:52 +0000 (13:16 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 11 Feb 2022 22:01:05 +0000 (22:01 +0000)
commitbadba359da9f09dfd75d81c7175b78eb1dbc998f
treeca17681fc7d366e25d7846d733032829c3e18dd6
parentbcee121ae4f67281450280c72399890a3c7a7d5b
go/types, types2: better error message for invalid array length

If an invalid array length is just an identifier, mention
"array length" so that it's clear this is an invalid array
declaration and not a (invalid) generic type declaration.

Fixes #51145.

Change-Id: I8878cbb6c7b1277fc0a9a014712ec8d55499c5c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/385255
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/types2/testdata/fixedbugs/issue43527.go2
src/cmd/compile/internal/types2/testdata/fixedbugs/issue51145.go [new file with mode: 0644]
src/cmd/compile/internal/types2/typexpr.go
src/go/types/errorcodes.go
src/go/types/testdata/fixedbugs/issue43527.go2
src/go/types/testdata/fixedbugs/issue51145.go [new file with mode: 0644]
src/go/types/typexpr.go
test/fixedbugs/bug255.go