Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/types, types2: bad error message for invalid array length #59209

Closed
griesemer opened this issue Mar 23, 2023 · 1 comment
Closed

go/types, types2: bad error message for invalid array length #59209

griesemer opened this issue Mar 23, 2023 · 1 comment
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

package p
type _ [1 << 100]byte

produces the type-check error:

x.go:2:9: array length 1 << 100 (untyped int constant 1267650600228229401496703205376) must be integer

The int constant is an integer.

@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 23, 2023
@griesemer griesemer added this to the Go1.21 milestone Mar 23, 2023
@griesemer griesemer self-assigned this Mar 23, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/479115 mentions this issue: go/types, types2: better error message for some invalid integer array lengths

johanbrandhorst pushed a commit to Pryz/go that referenced this issue Mar 28, 2023
… lengths

Don't say "array length must be integer" if it is in fact an integer.

Fixes golang#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>
@golang golang locked and limited conversation to collaborators Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants