<div dir="ltr"><div><div><div><div><div><div><div><div>Hello,<br><br></div>I have some code using the old "all.d" idiom, which I am changing to use the new "package.d" feature.<br><br></div>Originally, I had something like this:<br>

<br></div>// mylib/util.d:<br>module mylib.util;<br>class Foo { }<br><br></div>// mylib/all.d:<br>module mylib.all;<br>public import mylib.util;<br><br></div>// main.d:<br>import mylib.all;<br>void main()<br>{<br>   auto f = new mylib.util.Foo;<br>

}<br><br></div>And this used to work. Now, I added a new file:<br></div><br></div>// package.d<br><div>module mylib;<br>public import mylib.util;<br><br></div><div>And changed the 'import' in the main one:<br><br>

</div><div>// main.d<br></div><div>import mylib;<br><br>void main()<br>{<br>   auto f = new mylib.util.Foo;<br>}<br><br></div><div>Now, the compiler complains: <br><br>main.d(5): Error: undefined identifier 'util'<br>

main.d(5): Error: mylib.util.Foo is used as a type<br><br></div><div>Isn't this 'package.d' feature supposed to work just as the old 'all.d' and '_,d' we used before?<br></div><div><br></div><div>

(I see that I can use 'mylib.Foo' instead of 'mylib.util.Foo', but <a href="http://dlang.org/module.html">http://dlang.org/module.html</a> is clear saying that "[a]ll symbols from a publicly imported module are also aliased in the
    importing module. This means that if module D imports module C, and
    module C <i>publicly</i> imports module B which has the symbol <i>bar</i>,
    in module D you can access the symbol via <span class=""><span class="">bar</span></span>, <span class=""><span class="">B.bar</span></span>, and <span class=""><span class="">C.bar</span></span>.")<br><br></div>

<div>I am using DMD 2.064 here.<br></div><div><br></div><div>Thanks,<br><br></div><div>LMB<br><br></div></div>