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

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 176 - [module] message "module and package have the same name"
Summary: [module] message "module and package have the same name"
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: Walter Bright
URL:
Keywords: diagnostic, pull
: 2338 (view as issue list)
Depends on:
Blocks:
Reported: 2006年06月06日 10:55 UTC by Frank Benoit
Modified: 2015年06月09日 05:11 UTC (History)
6 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Frank Benoit 2006年06月06日 10:55:18 UTC
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 Leandro Lucarella 2009年11月13日 16:45:29 UTC
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 Leandro Lucarella 2009年11月13日 16:45:32 UTC
*** Issue 2338 has been marked as a duplicate of this issue. ***
Comment 3 Andrei Alexandrescu 2010年11月26日 10:26:37 UTC
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 Leandro Lucarella 2010年11月26日 10:50:51 UTC
/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 Andrei Alexandrescu 2010年11月26日 11:04:30 UTC
Marked issue as D1.
Comment 6 Leandro Lucarella 2010年11月26日 11:14:17 UTC
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 Andrei Alexandrescu 2010年11月26日 11:20:05 UTC
Just reproduced it now. I must've made a mistake earlier.
Comment 8 Andrei Alexandrescu 2010年11月26日 11:20:31 UTC
Assigning to Walter.
Comment 9 Leandro Lucarella 2010年11月26日 11:22:16 UTC
(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 Bernard Helyer 2011年04月11日 05:45:41 UTC
This is an incredibly stupid message.
Comment 12 github-bugzilla 2012年03月22日 13:56:39 UTC
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"


AltStyle によって変換されたページ (->オリジナル) /