<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><div class="">[resending to correct cfe-dev]</div><div class=""><br class=""></div><div class="">Hi, Richard. One of our Swift tests recently hit an interesting edge case involving modules and redefinitions. Take the following code:<br class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">// Module A</div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">struct Foo {</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>int x;</div><div class="">};</div><div class=""><br class=""></div><div class="">// Module B</div><div class="">struct Foo {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">      </span>int x;</div><div class="">};</div><div class=""><br class=""></div><div class="">// Module C</div><div class="">typedef struct Foo *FooPtr;</div><div class=""><br class=""></div><div class="">// main.m</div><div class="">@import A;</div><div class="">@import B;</div><div class="">@import C;</div></blockquote><br class=""><div class="">If all of this was in one file, we'd have an invalid redefinition of Foo, but because A and B are separate modules (and supposedly self-contained) Clang just cheats and treat one of them as a mere declaration. Because Clang modules don't affect lookup, that's fine. In Swift, however, I can ask for "A.Foo" or "B.Foo", and ideally both would resolve to <i class="">some</i> declaration of Foo. "C.Foo", on the other hand, should say "there's no 'Foo' in C" (because Swift doesn't have forward declarations).</div><div class=""><br class=""></div><div class="">I tried using isCompleteDefinition to distinguish the B case from the C case, but of course Clang doesn't consider the second definition to <i class="">be</i> a definition. Do you have any ideas?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Jordan</div></div></div></div></div><br class=""></body></html>