Here's another rather interesting case:

// mylib/util.d
module mylib.util;
class Foo { }

// mylib/package.d
module mylib;
public import mylib.util;

// main.d
import std.stdio;
import mylib;

void main()
{
   auto f = new mylib.Foo;
   writefln("%s", f.classinfo.name);
}

 This prints 'mylib.util.Foo'. So far so good, that's the name I originally
expected.

Then I try to instantiate a 'Foo' using this very fully-qualified name the
compiler told me:

   auto f = new mylib.util.Foo;

And DMD doesn't like it anymore:

main.d(6): Error: undefined identifier 'util'
main.d(6): Error: mylib.util.Foo is used as a type

Fishy, isn't it? Maybe I should report this as a bug?

Cheers,

LMB



On Wed, Dec 18, 2013 at 6:09 AM, Andrej Mitrovic <[email protected]
> wrote:

> On 12/17/13, Leandro Motta Barros <[email protected]> wrote:
> > Is there any documentation describing the expected to behavior in regard
> to
> > the fully-qualified names of the publicly imported symbols in package.d?
>
> It might have been an oversight, but we'll have to wait for (I think
> Kenji) to reply since he implemented packages.
>

Reply via email to