Skip to content
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: Go 1.20 recognizes clear built-in and panics #61326

Closed
dominikh opened this issue Jul 12, 2023 · 2 comments
Closed

cmd/compile: Go 1.20 recognizes clear built-in and panics #61326

dominikh opened this issue Jul 12, 2023 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge

Comments

@dominikh
Copy link
Member

What version of Go are you using (go version)?

$ go version
go version go1.20.6 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

go run the following file:

package main

func main() {
	clear(([]int)(nil))
}

What did you expect to see?

An error indicating that clear isn't defined, or that it needs Go 1.21

What did you see instead?

./foo.go:3:6: internal compiler error: panic: interface conversion: interface is nil, not ir.Node

When building a package in a module, instead of specifying a file, Go correctly reports that clear needs Go 1.21 if the Go version in go.mod is set to 1.20. However, if go.mod specifies 1.21, the same panic occurs.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 12, 2023
@ianlancetaylor
Copy link
Contributor

CC @mdempsky

@mdempsky
Copy link
Contributor

Duplicate of #61074.

@golang golang locked and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

4 participants