Skip to content

cmd/compile: type constraint containing any used directly as type #68710

Closed
@godcong

Description

@godcong

Proposal Details

type AnyType interface {
	any | []uint8
}

type KeySet struct {
	Keys []AnyType 
}

some issue content about this:
golang-jwt/jwt#401

The defined generic type AnyType can be used directly as a type and is compiled.

If you delete any, you will be prompted with

cannot use type AnyType outside a type constraint: interface contains type constraints

I haven't found anything about it, so I don't know if it's intentional or not.

If so, could you provide some relevant information?

Metadata

Metadata

Assignees

Labels

ExpertNeededNeedsInvestigationSomeone 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

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions