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.
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
*** Issue 2338 has been marked as a duplicate of this issue. ***
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
/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
Marked issue as D1.
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.
Just reproduced it now. I must've made a mistake earlier.
Assigning to Walter.
(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.
This is an incredibly stupid message.
https://github.com/D-Programming-Language/dmd/pull/822
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 によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル