> But if we are going to remove the ability to use typealiases bound to `Any`
> in constraints we need to introduce an alternative mechanism for factoring
> out constraints (hopefully a superior mechanism that can abstract over
> constraints that relate generic parameters to each other).
I could certainly imagine having, for instance, a `constraintalias` keyword:
constraintalias HashableAndComparable = Hashable, Comparable
constraintalias CollectionOfConforming<ElementConstraint> = Collection
where .Element: ElementConstraint
let value: Any<HashableAndComparable> = 123
func sum<C: CollectionOfConforming<Integer>>(numbers: C) ->
C.Iterator.Element {
return numbers.reduce(0, combine: +)
}
--
Brent Royal-Gordon
Architechies
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution