-
Notifications
You must be signed in to change notification settings - Fork 18k
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
cmd/compile: infinite loop with recursive generic types #56665
Comments
CC @golang/compiler |
Is this new in Go 1.20? |
I think this is a go/types issue. /cc @griesemer @findleyr
No, it repros on the playground in 1.18 and 1.19 too. |
The infinite recursion appears to be here:
|
More details: B is identified as invalid, but its underlying must not be marked as Typ[Invalid], allowing the type-checker to recurse while type-hashing.
|
Ok, this is ringing bells. When validating Simpler reproducer:
We can fix this by also marking the origin type |
Change https://go.dev/cl/449275 mentions this issue: |
Change https://go.dev/cl/451015 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. And on tip.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Try to compile this program:
What did you expect to see?
Something. Probably an error message, I assume this is somehow violating the rules against embedding type parameters or something.
What did you see instead?
The compiler hangs, eating CPU (one core and a bit), obviously in an endless loop of some kind.
The text was updated successfully, but these errors were encountered: