-
Notifications
You must be signed in to change notification settings - Fork 18k
go/types: panic in error reporting for invalid use of "init" [1.17 only] #48082
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
Comments
Change https://golang.org/cl/346309 mentions this issue: |
This error reporting code path did not have test coverage, and panics in 1.17 (filed as #48082). Add a test that would have reproduced the panic, for both go/types and cmd/compile/internal/types2. Change-Id: Icd5f54f8407e4ab57d432f44a129ecf6b2755feb Reviewed-on: https://go-review.googlesource.com/c/go/+/346309 Trust: Robert Findley <[email protected]> Run-TryBot: Robert Findley <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> TryBot-Result: Go Bot <[email protected]>
Though this panic should be rare, it has manifested at least once in in a vscode-go gopls crash report, and in a Google internal crash report. It is a regression, and in my opinion is worth fixing for 1.17.1. Marked as a release blocker to make sure it is not missed in any case. |
Change https://golang.org/cl/347071 mentions this issue: |
This is a straightforward port of CL 320490 to go/types. Fixes #48082 Change-Id: I763c806c777f926a563d8f9384764e5b3f7f083c Reviewed-on: https://go-review.googlesource.com/c/go/+/324732 Trust: Robert Findley <[email protected]> Run-TryBot: Robert Findley <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> (cherry picked from commit e32fab1) Reviewed-on: https://go-review.googlesource.com/c/go/+/347071
Closed by merging 678b07d to release-branch.go1.17. |
The fix in CL 324732 on the dev.typeparams branch should have been back-ported to 1.17, but was missed.
This can result in a panic in go/types when type checking the following invalid code
Please consider this for back-port to the next 1.17 minor release.
CC @griesemer @golang/release
The text was updated successfully, but these errors were encountered: