[swift-evolution] [Proposal][Discussion] Qualified Imports

Pyry Jahkola pyry.jahkola at iki.fi
Thu Jul 21 02:16:04 CDT 2016


Oops, hit Send too soon…

> Pyry Jahkola wrote:
> 
>     import A      // ok, unqualified import keeps A as a second-class identifier
>     import B as B // ok, qualified import makes B a first-class identifier in file scope
>     
>     typealias A = Int // ok, shadows the module name A
>     
>     typealias B = Int
>     // error: invalid redeclaration of 'Bar'
>     // note: previously declared here: 'import Bar as Bar'

Of course that last error message was meant to read:

    // error: invalid redeclaration of 'B'
    // note: previously declared here: 'import B as B'

— Pyry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160721/e6cf4e2b/attachment.html>


More information about the swift-evolution mailing list