[swift-evolution] extending typealiases

Anton Zhilin antonyzhilin at gmail.com
Mon Feb 6 12:06:15 CST 2017

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 <
swift-evolution at swift.org>:

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()
> }
> ‚Äč
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170206/0c08cd3d/attachment.html>

More information about the swift-evolution mailing list