Syntax for `T == P || T: P` is off-topic for current proposal, which is just about replacing `P` with `Any<P>`.
Currently, equivalent of `Any<P>` has no subtypes (besides itself). This is likely not going to be changed. So `where U : Any<P>` will not be allowed. Generalized existentials also don't solve this problem. Existential `Sequence` would look like this: `Any<Sequence where Iterator.Element : P>` Here, we can't accept `Iterator.Element == Any<P>` for the same reason that we can't accept `Any<P> : P` in any other place: static member requirements are not implemented. To solve this problem, we should invent another generic requirement, say `:==`, that prohibits calling static members on generic parameter. This should be a separate proposal. `Any<P>` can't help here, because the problem with calling static members only happens with static polymorphism.
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
