Skip to content

cmd/go2go: constraints that are type parameters #39723

Closed
@griesemer

Description

@griesemer

This is a design question: Should it be possible to use a type parameter as a constraint? For instance, should this be accepted:

func _(type A interface{ type interface{} }, B A)()

A is a type parameter, not an interface, but the constraint for A ensures that A eventually is an interface. This case even appears to satisfy the type-checker. More complex cases fail at the moment.

See also the 2nd example from #39711.

cc: @ianlancetaylor

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions