-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Description
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
Labels
FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.