Skip to content

spec: unclear whether it is ok to have a type parameter as the RHS in an alias type declaration #75885

@griesemer

Description

@griesemer

Per the spec:

In an alias declaration the given type cannot be a type parameter.

This matches the respective restriction we have for type definitions.
That said, we have quite a few (type checker) tests that declare local aliases for function type parameters.

This restriction should probably only apply to package-level alias declaration. But even that is not clear.
Needs to be investigated.

See also #75884.

cc: @findleyr @adonovan @mrkfrmn

Metadata

Metadata

Assignees

Labels

DocumentationIssues describing a change to documentation.LanguageProposalIssues describing a requested change to the Go language specification.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions