Bug 176 – [module] message "module and package have the same name"

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2006-06-06T10:55:00Z
Last change time
2015-06-09T05:11:57Z
Keywords
diagnostic, pull
Assigned to
bugzilla
Creator
benoit

Comments

Comment #0 by benoit — 2006-06-06T10:55:18Z
in file a.d: import lib.mod.d; // '.d' is a copy paste error in the directory 'lib' a 'mod.d' exists. The content of 'mod.d' is correct. if an import contains the ".d", which is wrong, the message does not point to this import. Instead it says: ..lib/mod.d: module lib.mod module and package have the same name.
Comment #1 by leandro.lucarella — 2009-11-13T16:45:29Z
Copying the (duplicated) bug 2338 text because it has a better description of the problem: Frank Benoit 2008-09-06 10:40:04 PDT ==== test.d ====== module test2; import test2; import test2.A; // (2) this wrong import can in another file ==== test2.d ====== module test2; ========== If one of the compiled files has a wrong import like (2) it happens DMD is pointing to a correct import or a simply wrong location: test2.d(3): module test2 module and package have the same name
Comment #2 by leandro.lucarella — 2009-11-13T16:45:32Z
*** Issue 2338 has been marked as a duplicate of this issue. ***
Comment #3 by andrei — 2010-11-26T10:26:37Z
I cannot reproduce this on 2.065, so I assume it has been fixed. The errror message is now: test2.d: Error: module test2 from file test2.d conflicts with another module test2 from file test.d
Comment #4 by leandro.lucarella — 2010-11-26T10:50:51Z
/tmp/dmd/dmd$ ./linux/bin/dmd | head -n 1 Digital Mars D Compiler v1.065 /tmp/dmd/dmd$ cat test.d module test2; import test2; import test2.A; // (2) this wrong import can in another file /tmp/dmd/dmd$ cat test2.d module test2; /tmp/dmd/dmd$ ./linux/bin/dmd -c test.d test.d: Error: module test2 module and package have the same name
Comment #5 by andrei — 2010-11-26T11:04:30Z
Marked issue as D1.
Comment #6 by leandro.lucarella — 2010-11-26T11:14:17Z
Are you kidding me? :) /tmp/dmd/dmd2$ ./linux/bin/dmd | head -n 1 Digital Mars D Compiler v2.050 /tmp/dmd/dmd2$ ./linux/bin/dmd -c test.d test.d: Error: module test2 module and package have the same name Marked as D1 & D2.
Comment #7 by andrei — 2010-11-26T11:20:05Z
Just reproduced it now. I must've made a mistake earlier.
Comment #8 by andrei — 2010-11-26T11:20:31Z
Assigning to Walter.
Comment #9 by leandro.lucarella — 2010-11-26T11:22:16Z
(In reply to comment #7) > Just reproduced it now. I must've made a mistake earlier. In the comments, you were compiling test2.d and the problem is when compiling test.d, I guess that was the root of the confusion.
Comment #10 by b.helyer — 2011-04-11T05:45:41Z
This is an incredibly stupid message.
Comment #11 by clugdbug — 2012-03-22T03:22:08Z
Comment #12 by github-bugzilla — 2012-03-22T13:56:39Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b4803b2f262df4c9ee0d2d0d3613c60801687382 Fix issue 176 [module] message "module and package have the same name" Generate a comprehensible error at a higher level (at the import statement). https://github.com/D-Programming-Language/dmd/commit/82d5734ae09fec1a98edaf69ea731ebef905a9a8 Merge pull request #822 from donc/moduleAndPackageSameName Bug 176. Error message "module and package have the same name"