<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span></span></div><div><div><br>~Robert Widmann</div><div><br>2016/07/21 1:43、Pyry Jahkola &lt;<a href="mailto:pyry.jahkola@iki.fi">pyry.jahkola@iki.fi</a>&gt; のメッセージ:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div class="">Back to the pre-proposal itself,</div><div class=""><br class=""></div><div class="">I support taking it forward and it being accepted in <i class="">some</i> form. However, I remain unconvinced that we'd ever want `<b class=""><font face="Menlo" class="">hiding</font></b>` imports in Swift.</div><div class=""><br class=""></div><div class="">Here are a few specific comments on the text (8 in total):</div><div class=""><blockquote type="cite" class=""><h2 class="" style="box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);">Motivation</h2><h1 class="" style="box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;"><p class="" style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;">The existing syntax for qualified imports from modules is needlessly explicit, does not compose, and has a default semantics that dilutes the intended meaning of the very operation itself. Today, a qualified import looks something like this</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; font-size: 16px; font-weight: normal;"><pre class="" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;"><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">import</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">class</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Foundation.Date</span></pre></div><p class="" style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;">This means that clients of Foundation that wish to see only&nbsp;<code class="" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">Date</code>&nbsp;must know the exact kind of declaration that identifier is.</p></h1></blockquote></div><div>1. Given this motivation, isn't it sufficient being able to import <i class="">without</i>&nbsp;knowing the exact kind of declaration? In other words, I agree we want `<b class=""><font face="Menlo" class="">using</font></b>` imports, but what motivates `<b class=""><font face="Menlo" class="">hiding</font></b>` imports really?</div><div><br class=""></div><div>As it was pointed out by Félix, the use of&nbsp;`<b class=""><font face="Menlo" class="">hiding</font></b>`&nbsp;imports moves away the focus of what <b class="">is</b> imported into what <b class="">is not</b> imported, and while name conflict problems usually arise when importing another module on top of already working code, I think it's better to fix them at the import statement which brings in the winning name declaration, i.e. the `<b class=""><font face="Menlo" class="">using</font></b>` import.</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><h2 style="box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);" class=""><a id="user-content-proposed-solution" class="anchor" href="https://gist.github.com/CodaFi/42e5e5e94d857547abc381d9a9d0afd6#proposed-solution" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Proposed solution</h2><h1 style="box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;" class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;" class="">The grammar and semantics of qualified imports will change completely with the addition of&nbsp;<em style="box-sizing: border-box;" class="">import qualifiers</em>&nbsp;and&nbsp;<em style="box-sizing: border-box;" class="">import directives</em>. We also introduce two new contextual keywords:&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">using</code>&nbsp;and&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">hiding</code>, to facilitate fine-grained usage of module contents.</p></h1></div></div></div></blockquote><br class="">2. Is there a typo above? The proposal does not mention <i class="">import qualifiers</i> anywhere else. I guess those are part of what got postponed into later proposals.</div><div><br class=""></div></div></blockquote><div><br></div>It is.<br><blockquote type="cite"><div><div><br class=""><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><h2 style="box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);" class="">Detailed design</h2><h1 style="box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;" class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;" class="">1)&nbsp;<em class="" style="box-sizing: border-box;">using</em>: The&nbsp;<em class="" style="box-sizing: border-box;">using</em>&nbsp;directive is followed by a list of identifiers for non-member nominal declarations within the imported module that should be exposed to this file.&nbsp;</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; font-size: 16px; font-weight: normal;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// The only visible parts of Foundation in this file are </span>
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// Foundation.Date, Foundation.DateFormatter, and Foundation.DateComponents</span>
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">//</span>
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// Previously, this was</span>
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// import class Foundation.Date</span>
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// import class Foundation.DateFormatter</span>
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// import class Foundation.DateComponents</span>
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">import</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Foundation</span> using (Date, DateFormatter, DateComponents)</pre></div></h1></div></div></blockquote><div>3. I support the idea of `<b class=""><font face="Menlo" class="">using</font></b>` imports. That's something we do need, and its introduction is sufficient to cover the existing use cases of the old selective import syntax about to be deprecated here.</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><h1 style="box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;" class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;" class="">2)&nbsp;<em style="box-sizing: border-box;" class="">hiding</em>: The&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">hiding</code>&nbsp;directive is followed by a list of identifiers for non-member nominal declarations within the imported module that should be hidden from this file.</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; font-size: 16px; font-weight: normal;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// Imports all of Foundation except `Date`</span>
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">import</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Foundation</span> hiding (Date)</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;" class="">As today, all hidden identifiers do not hide the type, they merely hide that type’s members and its declaration. For example, this means values of hidden types are still allowed. Unlike the existing implementation, using their members is forbidden.</p></h1></div></div></div></blockquote><div>4. Hmm, the above design detail is easily missed when reading the proposal. So what you're proposing is that the <i class="">hiding</i> of <font face="Menlo" class="">Date</font> essentially turns&nbsp;<span style="font-family: Menlo;" class="">Date</span>&nbsp;into a type that the code will know almost nothing about, except it's something we can pass to other types' methods that expect a&nbsp;<span style="font-family: Menlo;" class="">Date</span>, am I right?</div><div><br class=""></div><div>What's the benefit in that? Do you anticipate it will make importing lighter somehow, possibly improving compilation or library loading speed? You mentioned something along those lines in the Motivation, but I'm not sure if I got it right here.</div></div></div></blockquote><div><br></div><div>It is so that use of an API in a framework like Foundation does not necessitate polluting your Swift files with a million using imports - thus defeating the purpose of this proposal. &nbsp;DateFormatter alone needs to know about Date, String, TimeInterval, Calendar, Locale, and TimeZone. &nbsp;Each of those needs to know about additional components. &nbsp;To require an import decl to use these types explicitly would be madness. &nbsp;You'd just wind up importing Foundation anyway.</div><br><blockquote type="cite"><div><div><div><br class=""></div><div><br class=""></div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><h1 style="box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;" class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;" class="">Import directives chain to one another and can be used to create a fine-grained module import:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; font-size: 16px; font-weight: normal;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// This imports Swift.Int, Swift.Double, and Swift.String but hides Swift.String.UTF8View</span>
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">import</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Swift</span> using (<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">String</span>, <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Int</span>, <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Double</span>) 
             hiding (<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">String</span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span>UTF8View)</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;" class="">Directive chaining occurs left-to-right:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; font-size: 16px; font-weight: normal;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// This says to 1) Use Int 2) Hide String 3) rename Double to Triple.  It is invalid</span>
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// because 1) Int is available 2) String is not, error.</span>
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">import</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Swift</span> using (<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Int</span>) hiding (<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">String</span>)
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// Valid.  This will be merged as `using (Int)`</span>
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">import</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Swift</span> using () using (<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Int</span>)
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// Valid.  This will be merged as `hiding (String, Double)`</span>
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">import</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Swift</span> hiding (<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">String</span>) hiding (<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Double</span>) hiding ()
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// Valid (if redundant). This will be merged as `using ()`</span>
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">import</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Swift</span> using (<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">String</span>) hiding (<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">String</span>)</pre></div></h1></div></div></div></blockquote><div>5. These chaining rules do fit on the back of a napkin, but I'm not sure if we need them at all. I'm not convinced we need `<b class=""><font face="Menlo" class="">hiding</font></b>` imports, and without hiding imports, we need no rules for the order of imports.</div><div><br class=""></div></div></div></blockquote><div><br></div>How else are we to allow you to import a using type but not any of its member types? &nbsp;How could we support removing APIs related to NSCell in AppKit apps? How about NSStream everywhere else? How else can we allow, in the future, the ability to import NSObject but none of its KVO-related members? &nbsp;A hiding import is an invariant: It says a particular API should never be considered for use in this file. &nbsp;The very act of 'using' an identifier means you are hiding all others. &nbsp;The very act of 'hiding' an identifier means you are using all others.</div><div><br><blockquote type="cite"><div><div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><h1 style="box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;" class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;" class="">Because import directives are file-local, they will never be exported along with the module that declares them.</p></h1></div></div></div></blockquote><div>6. +1 on imports being file-local, that's essentially what we have today.</div><div><br class=""></div><div>What I will keep suggesting is that `<font face="Menlo" class=""><b class="">using</b></font>` imports actually take up the name in the file-local scope such that nothing else in the same file's scope — be it another `<font face="Menlo" class=""><b class="">import</b> ...&nbsp;<b class="">using</b> (...)</font>`, a local type declaration, function, or value — can declare the same name with a different meaning. That way, a plain</div><div><font face="Menlo" class=""><b class=""><br class=""></b></font></div><div><font face="Menlo" class=""><b class="">&nbsp; &nbsp; import</b> Foo</font></div><div><br class=""></div><div>can import everything from <font face="Menlo" class="">Foo</font>, while another</div><div><font face="Menlo" class=""><b class=""><br class=""></b></font></div><div><font face="Menlo" class=""><b class="">&nbsp; &nbsp; import</b> Foo <b class="">using</b> (Bar)</font></div><div><br class=""></div><div>can be used to explicitly choose the <font face="Menlo" class="">Bar</font> the code is about to use.</div></div></div></blockquote><div><br></div>That was the plan. &nbsp;You will receive an "invalid redeclaration" error as always.</div><div>&nbsp;<br><blockquote type="cite"><div><div><div><br class=""></div><div><br class=""></div><div>7. (Off-topic to this proposal.) Given that you briefly expressed the interest in turning imports `<b class=""><font face="Menlo" class="">public</font></b>` or `<b class=""><font face="Menlo" class="">internal</font></b>` — some of which would indeed be useful in a better module system —, I think it's curious&nbsp;in that design&nbsp;that the default visibility level of imports would likely be `<b class=""><font face="Menlo" class="">fileprivate</font></b>`, which is different from the rest of Swift. That said, I think it's <b class="">absolutely right</b> for imports to remain file-local by default, because explicit tends to be better than implicit.</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><h2 style="box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);" class="">Impact on existing code</h2><h1 style="box-sizing: border-box; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255); margin-top: 0px !important;" class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;" class="">Existing code that is using qualified module import syntax (<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">import {func|class|typealias|class|struct|enum|protocol} &lt;qualified-name&gt;</code>) will be deprecated and should be removed or migrated.&nbsp;</p></h1></div></div></div></blockquote><div>8. +1 on deprecating the old selective import syntax.</div><div><br class=""></div><div>Thank you for driving this forward!</div><br class=""></div>— Pyry<br class=""><div class=""><br class=""></div></div></blockquote></div></body></html>