Skip to content

go/types, types2: type checker accepts invalid program #75884

@griesemer

Description

@griesemer

Per the spec:

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

thus, the following code is invalid, yet the type checker accepts it (playground):

type A[P any] = P

Metadata

Metadata

Labels

BugReportIssues describing a possible bug in the Go implementation.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions