<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Oops, hit Send too soon…</div><br class=""><div><blockquote type="cite" class=""><div class="">Pyry Jahkola wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="" style="font-family: Menlo;"> </span><b class="" style="font-family: Menlo;">import</b><span class="" style="font-family: Menlo;"> A</span><font color="#919191" class="" style="font-family: Menlo;"> // ok, unqualified import keeps A as a second-class identifier</font></div><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="" style="font-family: Menlo;"> </span><b class="" style="font-family: Menlo;">import</b><span class="" style="font-family: Menlo;"><span class="Apple-converted-space"> </span>B<span class="Apple-converted-space"> </span></span><b class="" style="font-family: Menlo;">as</b><span class="" style="font-family: Menlo;"><span class="Apple-converted-space"> </span>B</span><font color="#919191" class="" style="font-family: Menlo;"><span class="Apple-converted-space"> </span>// ok, qualified import makes B a first-class identifier in file scope</font></div><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font color="#919191" class="" style="font-family: Menlo;"> </font></div><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font face="Menlo" class=""> <b class="">typealias</b> A = Int<span class="Apple-converted-space"> </span><font color="#919191" class="">// ok, shadows the module name A</font></font></div><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font face="Menlo" class=""><font color="#919191" class=""> </font></font></div><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font face="Menlo" class=""> <span class="Apple-converted-space"> </span><font color="#ff2600" class=""><b class="">typealias</b><span class="Apple-converted-space"> </span>B = Int</font></font></div><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font face="Menlo" class=""><font color="#919191" class=""> //<span class="Apple-converted-space"> </span></font><b class=""><font color="#ff2600" class="">error:</font></b><font color="#919191" class=""><span class="Apple-converted-space"> </span>invalid redeclaration of 'Bar'</font></font></div><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><font face="Menlo" color="#919191" class=""> //<span class="Apple-converted-space"> </span><b class="">note:</b><span class="Apple-converted-space"> </span>previously declared here: 'import Bar as Bar'</font></div></div></blockquote></div><br class="">
Of course that last error message was meant to read:<div class=""><br class=""></div><div class=""><div class=""><div class=""><font face="Menlo" class=""><font color="#919191" class=""> // </font><b class=""><font color="#ff2600" class="">error:</font></b><font color="#919191" class=""> invalid redeclaration of 'B'</font></font></div></div><div class=""><font face="Menlo" color="#919191" class=""> // <b class="">note:</b> previously declared here: 'import B as B'</font></div></div><div class=""><br class=""></div><div class="">— Pyry</div><div class=""><br class=""></div></body></html>