<div dir="ltr">Here's another rather interesting case:<br><br>// mylib/util.d <br>module mylib.util;<br>class Foo { }<br><br>// mylib/package.d <br>module mylib;<br>public import mylib.util;<br><br><div class="gmail_extra">
// main.d <br>import std.stdio;<br>import mylib;<br><br>void main()<br>{<br> auto f = new mylib.Foo;<br> writefln("%s", <a href="http://f.classinfo.name" target="_blank">f.classinfo.name</a>);<br>}<br><br></div>
<div class="gmail_extra">
This prints 'mylib.util.Foo'. So far so good, that's the name I originally expected.<br><br></div><div class="gmail_extra">Then I try to instantiate a 'Foo' using this very fully-qualified name the compiler told me:<br>
</div><div class="gmail_extra"><br> auto f = new mylib.util.Foo;<br><br>And DMD doesn't like it anymore:<br><br>main.d(6): Error: undefined identifier 'util'<br>main.d(6): Error: mylib.util.Foo is used as a type<br>
<br></div><div class="gmail_extra">Fishy, isn't it? Maybe I should report this as a bug?<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">
LMB<br></div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 18, 2013 at 6:09 AM, Andrej Mitrovic <span dir="ltr"><<a href="mailto:andrej.mitrovich@gmail.com" target="_blank">andrej.mitrovich@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 12/17/13, Leandro Motta Barros <<a href="mailto:lmb@stackedboxes.org">lmb@stackedboxes.org</a>> wrote:<br>
> Is there any documentation describing the expected to behavior in regard to<br>
> the fully-qualified names of the publicly imported symbols in package.d?<br>
<br>
</div>It might have been an oversight, but we'll have to wait for (I think<br>
Kenji) to reply since he implemented packages.<br>
</blockquote></div><br></div>