-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: ICE: "runtime error: index out of range [0] with length 0" due to generic code #52162
Comments
I just realised that changing |
Here is a shorter reproducer:
https://go.dev/play/p/pn99Ydje_nL I think part of the problem is that the callback is named the same as the generic type. |
Even shorter:
|
|
This works in 1.18. |
Do you mean this works at tip? The playground links are for Go 1.18, which are reproducing the issue. I'm not able to reproduce at tip. I am able to reproduce with "go1.18-pre13". |
Interesting. I can reproduce the crash with
but I can't reproduce it with
|
And I can't reproduce it on tip. Sounds like this has been fixed. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://go.dev/play/p/TgQFW3CWM12
What did you expect to see?
A error with a file and a line number, I can goto and fix.
What did you see instead?
:1: internal compiler error: panic: runtime error: index out of range [0] with length 0
Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
Go build failed.
I really did not expect a request for a bug report, but here it is! ;-)
The text was updated successfully, but these errors were encountered: