Okay fine. I’m curious if we ever should be able to extend existentials. (Could
be really handy.)
typealias FooView = UIView & Foo
extension FooView {
func foo() { .. }
}
// vs.
extension UIView where Self : Foo { .. }
--
Adrian Zubarev
Sent with Airmail
Am 6. Februar 2017 um 19:06:16, Anton Zhilin ([email protected]) schrieb:
If I understand correctly, extension of a typealias should be strictly
equivalent to extension of type on the right:
extension Any<class> {
func foo()
}
And
Any<...> are not nominal types, so until we additionally allow extensions for
non-nominal types, this will not compile.
2017-02-06 20:51 GMT+03:00 Adrian Zubarev via swift-evolution
<[email protected]>:
Just imagining the future. Iff this request will made into the language and we
had typealias AnyObject = Any<class>, would the following be valid?
extension AnyObject {
func foo()
}
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution