-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: internal compiler error: panic: interface conversion: interface is nil, not ir.Node #61074
Comments
It's worth noting the impact of this crash is limited; it only impacts valid Go 1.21 code using
And with go1.20.5 any name other than
I've been testing by directly running the source file (
So I believe this will only impact code which correctly uses |
cc @mdempsky @griesemer for decision. |
go1.20 should report the error
(playground). |
go1.20 and go1.20.x trigger ICE in my local, not sure why playground doesn't. |
Playground autogenerates a 1.20 go.mod file I think. This repros it: https://go.dev/play/p/sbnZ28wE-s6 I think the issue is 1.20 typechecker understands clear and allows it sometimes, but the backend doesn't have it at all. |
The problem here is basically just a worse error message: the Go 1.20 compiler is crashing and reporting an ICE instead of giving a standard error message when trying to compile Go 1.21 code. We could backport a fix to report a nicer error message, but I don't think that really lives up to the standard we normally expect of backports. And it's not an issue with 1.21 or moving forward. |
What version of Go are you using (
go version
)?I'm using 1.20.5 from https://pkg.go.dev/golang.org/dl/go1.20.5
Does this issue reproduce with the latest release?
Yes, with 1.20.5. It does not reproduce with 1.21rc2.
What operating system and processor architecture are you using (
go env
)?I'm running on darwin/arm64. I've also reproduced on linux/amd64.
go env
OutputWhat did you do?
I was testing the new
clear
builtin on go1.21rc2, then ran the same code on go1.20.5. I expected the compilation to fail due to the undefinedclear
function; instead the compiler panicked. I minimized to the following program:And see the following error:
What did you expect to see?
A compilation error ("./clear.go:5:9: undefined: clear") on go1.20.5.
Successful compilation on go1.21rc2.
What did you see instead?
Successful compilation on go1.21rc2. 👍
An internal compiler error panic with go1.20.5:
The text was updated successfully, but these errors were encountered: