<div dir="ltr">On Fri, Nov 1, 2013 at 6:47 PM, Dmitri Gribenko <span dir="ltr"><<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Oct 31, 2013 at 6:47 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>

> I had a go at writing a test for this (attached). However... my test fails<br>
> both with and without your change.<br>
<br>
</div>Indeed.  Seems like it fails because:<br>
- recursive_visibility_a.inner is not imported (only recursive_visibility_a is),<br>
- thus the 'inner' submodule is not showing up in any of the import lists,<br>
- and because of this getExportedModules() is not returning the<br>
correct module set -- it only considers modules that are imported.<br>
<br>
Should it also add the immediate exported submodules to the list,<br>
along with re-exported modules?  I'm not sure about the best way to<br>
implement this.<br>
<br>
Also, I think using ADL in templates is a very indirect way of testing<br>
this (although, I should admit, a real-life way of testing).</blockquote><div><br></div><div>Name visibility in template instantiations is the only thing that isModuleVisible is used for at the moment, and ADL seemed like a reasonable way of triggering that lookup.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  I<br>
thought it would be useful to have a tool that dumps the visibility<br>
sets for modules imported in a given TU (possibly explaining why a<br>
certain module is visible).  This would not only simplify debugging,<br>
but would allow us to test this easily.</blockquote><div><br></div><div>That'd be a significant investment in infrastructure for something whose observable effects we can already test, but if you want to go that way, I won't complain =) I'd like to have the lit test regardless, though, to test the observable behavior.</div>
</div></div></div>