Can we use `Any<…>` for protocol conformance like this:
protocol A: Any<class> {} <— this makes a little sense, but I’d rather write
protocol A: class {} instead
protocol B: Any<UIView, SomeProtocol> <— this is confusing. One could argue we
could apply B only on any UIView subclass which conforms to SomeProtocol, but
why can’t we do also this: protocol C: Any<UIView>
One downside here is that `Any<UIView> == UIView` and should be banned because
its redundant.
We cannot write something like this:
protocol C: UIView
Or can we?
I’d propose we should ban this in Swift 3.
This implies that `typealias AnyObject = Any<class>` won’t work anymore on
protocols. This is a breaking change.
I’d write a small proposal as another follow up to SE-0095 if my thoughts are
right.
--
Adrian Zubarev
Sent with Airmail
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution