Skip to content

go/types: assertion failure in recent range statement checking logic [1.22 backport] #68370

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

Closed
gopherbot opened this issue Jul 10, 2024 · 3 comments
Assignees
Labels
CherryPickApproved Used during the release process for point releases
Milestone

Comments

@gopherbot
Copy link
Contributor

@findleyr requested issue #68334 to be considered for backport to the next 1.22 minor release.

@gopherbot please backport this issue to 1.22. It is a regression in the latest patch release and causes crashes in gopls.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Jul 10, 2024
@gopherbot gopherbot added this to the Go1.22.6 milestone Jul 10, 2024
@cagedmantis
Copy link
Contributor

Approved as it is a regression in the latest patch release and causes crashes in gopls.

@cagedmantis cagedmantis added the CherryPickApproved Used during the release process for point releases label Jul 10, 2024
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Jul 10, 2024
@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/598055 mentions this issue: [release-branch.go1.22] go/types: fix assertion failure when range over int is not permitted

gopherbot pushed a commit that referenced this issue Jul 16, 2024

Verified

This commit was signed with the committer’s verified signature.
Darksonn Alice Ryhl
…er int is not permitted

Fixes an assertion failure in Checker.rangeStmt that range over int
only has a key type and no value type. When allowVersion failed,
rangeKeyVal returns Typ[Invalid] for the value instead of nil. When
Config.Error != nil, rangeStmt proceeded. The check for rhs[1]==nil
was not enough to catch this case. It must also check rhs[1]==

Fixes #68334
Fixes #68370

Change-Id: Iffa1b2f7b6a94570ec50b8c6603e727a45ba3357
Reviewed-on: https://go-review.googlesource.com/c/go/+/597356
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit 4e77872)
Reviewed-on: https://go-review.googlesource.com/c/go/+/598055
@gopherbot
Copy link
Contributor Author

Closed by merging CL 598055 (commit 4b27560) to release-branch.go1.22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases
Projects
None yet
Development

No branches or pull requests

3 participants