www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - module ... conflicts with package name ...

reply Steven Schveighoffer <schveiguy gmail.com> writes:
I have a directory structure like this (names are changed, but 
essentially they shouldn't matter):

source/foo/package.d
source/foo/bar/package.d

with foo.package.d containing a public import of foo.bar, and foo.bar 
containing various public imports from elsewhere.

I get the following message:

Error: module foo.bar from file source/foo/bar/package.d conflicts with 
package name bar

What? I have no idea why this works in other places but not here. Is 
this a real thing? Has anyone experienced this and can point at a 
bugzilla for it?

I found this fixed issue from 2013: 
https://issues.dlang.org/show_bug.cgi?id=10302 which has similar error 
message.


If I remove the module definition it starts compiling. Is that right?

I can't reproduce with a small example. Before I try and go through the 
process to reduce this, just wanted to see if anyone knows about this.

-Steve
Feb 03 2020
parent reply Boris Carvajal <boris2.9 gmail.com> writes:
On Monday, 3 February 2020 at 16:35:06 UTC, Steven Schveighoffer 
wrote:
 I can't reproduce with a small example. Before I try and go 
 through the process to reduce this, just wanted to see if 
 anyone knows about this.

 -Steve
I've made a few changes to the package.d import code, one is pending. If you can reduce it to a test case I'll check it promptly.
Feb 03 2020
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 2/3/20 2:18 PM, Boris Carvajal wrote:
 On Monday, 3 February 2020 at 16:35:06 UTC, Steven Schveighoffer wrote:
 I can't reproduce with a small example. Before I try and go through 
 the process to reduce this, just wanted to see if anyone knows about 
 this.
I've made a few changes to the package.d import code, one is pending. If you can reduce it to a test case I'll check it promptly.
Pilot error. One of my other package modules declared itself to be the same module name (facepalm) HOWEVER, I will file a bug on this. If you have two packages claiming to be the same module package, it would be helpful if it showed the previously declared filename/location. -Steve
Feb 05 2020
parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 2/5/20 6:50 PM, Steven Schveighoffer wrote:
 HOWEVER, I will file a bug on this. If you have two packages claiming to 
 be the same module package, it would be helpful if it showed the 
 previously declared filename/location.
https://issues.dlang.org/show_bug.cgi?id=20563 -Steve
Feb 05 2020