-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.release-blocker
Milestone
Description
Go version
go version go1.25.4 darwin/arm64
Output of go env in your module/workspace:
-What did you do?
This is nonsense code, obviously. But the panic happened while doing real work and just having my code in a temporarily broken state as I was rewriting parts of it, which had gopls crash. Minimal repro:
package main
func main() {
s := "hello"
msg := append(nil, s...)
print(msg)
}What did you see happen?
gopls crash consistently, so I also tried go run
go run main.go
# command-line-arguments
<unknown line number>: internal compiler error: panic: cmd/compile/internal/types2/builtins.go:1093: assertion failed
Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
What did you expect to see?
A compiler error without the panic. 1.24 seems to do the right thing:
go version
go version go1.24.2 darwin/arm64
go run main.go
# command-line-arguments
./main.go:5:16: first argument to append must be a slice; have untyped nil
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.release-blocker