Skip to content

cmd/compile: spurious not a slice error when calling unsafe.SliceData on a type-parameterized slice #64406

@bcmills

Description

@bcmills

Go version

Go 1.21 (playground)

What operating system and processor architecture are you using (go env)?

playground

What did you do?

https://go.dev/play/p/1onZLUkD_VX

What did you expect to see?

successful compilation

What did you see instead?

./prog.go:8:26: invalid argument: s (variable of type S constrained by ~[]E) is not a slice

But it clearly is a slice, because (according to the same error message) it is constrained by ~[]E.

(attn @griesemer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions