Skip to content

cmd/compile: better error messages for use of ... with type parameters #43680

@griesemer

Description

@griesemer

For main.go:

package p
func _[T ...any]() {}

The compiler reports

main.go:2:10: ...any is not a type
main.go:2:10: invalid use of '...'

with go tool compile -G main.go.

The error messages should be better. ... should not be permitted for type parameters during parsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions