conflicting alias in package module

60rntogo 60rntogo at gmail.com
Sat Sep 26 07:33:05 UTC 2020


I have a package with the following structure:

pack
|- foo.d
|- bar.d
|- package.d

and the modules look like this:

---
module pack.foo;

struct Foo {}
---
module pack.bar;

import pack : Foo;
---
module pack;

public import pack.foo, pack.bar;
---

and this is an error: "struct pack.foo.Foo at 
source/pack/foo.d(3,1) conflicts with alias pack.bar.Foo at 
source/pack/bar.d(3,8)". I seems like the import in package.d 
sees Foo both in pack.foo and pack.bar, but I don't understand 
why this happens since the import in bar.d is private, isn't it?


More information about the Digitalmars-d-learn mailing list