-
Notifications
You must be signed in to change notification settings - Fork 18k
go/types, types2: nil underlying for selectors on the current type decl #51509
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
It's notoriously difficult to prevent crashes in a compiler. We should fix this of course, but I think we'd be ok even if this made it into the release as this is pretty pathological. |
Change https://go.dev/cl/390314 mentions this issue: |
Yes: a compiler crash should be fixed, of course, but in general a compiler crash on invalid code is not a release blocker. It's just a really really bad error message. |
Agree that it may not be a release blocker, though it also crashes gopls in which case it is more than an error message. One argument for the severity / commonality of this pattern is that it was introduced in https://go.dev/cl/378175, i.e. post beta, and seems to have been encountered pretty quickly inside of Google. |
Change https://go.dev/cl/390423 mentions this issue: |
…ferring to the type being declared In Checker.typInternal, the SelectorExpr case was the only case that didn't either set or pass along the incoming def *Named type. Handle this by passing it along to Checker.selector and report a cycle if one is detected. Fixes #51509. Change-Id: I6c2d46835f225aeb4cb25fe0ae55f6180cef038b Reviewed-on: https://go-review.googlesource.com/c/go/+/390314 Trust: Robert Griesemer <[email protected]> Reviewed-by: Robert Findley <[email protected]> (cherry picked from commit 114d5de) Reviewed-on: https://go-review.googlesource.com/c/go/+/390423 Trust: Dmitri Shuralyov <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
The following code crashes the type checker with a "nil underlying" panic, because we try to check the underlying when selection fails:
https://go.dev/play/p/H3Dv94uxQL9?v=gotip
Marking as a release blocker as this is a crash.
CC @griesemer
The text was updated successfully, but these errors were encountered: