Skip to content

cmd/compile: panic on invalid generic append with type parameter spread #78163

@bmizerany

Description

@bmizerany

Go compiler panic on invalid generic append

Repro

// appendpanic.go
package p

func f[T any](x T) {
	_ = append([]byte{}, x...)
}

Run:

go build appendpanic.go

Expected

A normal compile/type error.

Actual

<unknown line number>: internal compiler error: panic: runtime error: invalid memory address or nil pointer dereference

Environment

  • go version go1.26.1 darwin/arm64

Metadata

Metadata

Assignees

Labels

BugReportIssues describing a possible bug in the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.release-blocker

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions