<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hey, Victor. This is a longstanding issue that has to do with us resolving extensions very early in compilation; there are a handful of reports on JIRA and Radar but no one's really had the chance to look into it. The issues should be inconsistent but deterministic, i.e. it would only affect some files and not others, but it won't <i class="">change</i>&nbsp;from affecting one file to not affecting it if there are no changes in the code.</div><div class=""><br class=""></div><div class="">The safest workaround is to define your types at the top-level and use typealiases to make them nested, and have the extensions refer to the top-level type.</div><div class=""><br class=""></div><div class="">Sorry for the inconvenience,</div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 7, 2016, at 16:48, Victor Leong via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hey guys,&nbsp;<div class=""><br class=""></div><div class="">I'm starting to see problems related struct namespacing with extensions. For example:</div><div class=""><br class=""></div><div class="">I have the following definition in file: "aaa.swift":</div><div class="">public struct aaa {</div><div class="">&nbsp; &nbsp;public struct bbb {</div><div class="">&nbsp; &nbsp; &nbsp; public struct ccc{</div><div class="">&nbsp; &nbsp; &nbsp; ...</div><div class="">&nbsp; &nbsp; &nbsp; }</div><div class="">&nbsp; &nbsp;}</div><div class="">}</div><div class=""><br class=""></div><div class="">I have a second find: "bbb.swift" that tries to use:</div><div class="">aaa.bbb.ccc but it would say ccc is not a member of aaa.bbb.</div><div class=""><br class=""></div><div class="">If I move the code to file "aaa.swift" then the compile would work.</div><div class=""><br class=""></div><div class="">What I noticed is that this isn't deterministic either, it would happen for only a few namespaces in certain files.</div><div class=""><br class=""></div><div class="">Am I doing something wrong?<br clear="all" class=""><div class=""><br class=""></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><span style="font-size:12.8px" class="">Thanks,</span></div><div class=""><b style="font-size:12.8px" class="">Victor Leong </b><span style="font-size:12.8px" class="">|</span><b style="font-size:12.8px" class="">&nbsp;Software Developer</b><br class=""></div><div class=""><a href="mailto:victor.leong@visiercorp.com" target="_blank" class="">victor.leong@visiercorp.com</a></div><div class=""><br class=""></div></div></div></div></div></div></div>
</div></div>
_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></body></html>