[Issue 8748] New: the module name must not be unique in the pack and its subpacks
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 3 14:27:10 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8748
Summary: the module name must not be unique in the pack and its
subpacks
Product: D
Version: D2
Platform: x86
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: blazej.podsiadlo at gmail.com
--- Comment #0 from Blazej Podsiadlo <blazej.podsiadlo at gmail.com> 2012-10-03 14:21:07 PDT ---
Created an attachment (id=1145)
the full use case
Hi,
I've got following problem:
It's possible to build following library:
the_lib/
├── sub_pack
│ └── the_mod.d
└── the_mod.d
by following commands:
mkdir -p build/the_lib
mkdir -p build/the_lib/sub_pack
cd build
dmd -c -I../ ../the_lib/sub_pack/the_mod.d -ofthe_lib/sub_pack/the_mod.o
dmd -c -I../ ../the_lib/the_mod.d -ofthe_lib/the_mod.o
dmd -lib -I../ the_lib/the_mod.o the_lib/sub_pack/the_mod.o
-ofthe_lib/libTheLib
However it's not possible to use it later on:
import the_lib.the_mod;
import the_lib.sub_pack.the_mod;
import std.stdio;
void main()
{
writeln("the_app::main()");
the_lib.the_mod.the_fun();
the_lib.sub_pack.the_mod.the_fun();
}
built by:
dmd -c -I../ ../the_app/main.d -ofthe_app/main.o
dmd the_app/main.o the_lib/libTheLib.a -ofthe_app/main
produces:
../the_app/main.d(2): Error: module the_mod from file
../the_lib/sub_pack/the_mod.d conflicts with another module the_mod from file
../the_lib/the_mod.d
=================
in the same time when I try following code:
[developer at prv-dev-srv dmd-bug]$ cat the_app/clue.d
import the_lib.sub_pack.the_mod;
import std.stdio;
void main()
{
writeln("the_app::main()");
the_lib.sub_pack.the_mod.the_fun();
}
compiles, but doesn't work as intended:
execution of: the_lib.sub_pack.the_mod.the_fun();
executes code of the_lib.the_mod.the_fun();
I think that case, is much more serious than the first one because leads to
unexpected behaviours and does not produce any warnings/errors.
===================
I've attached the preprepared "project" demonstrating that issue (dmd-bug) and
as well some "workaround" (dmd-fine) where all modules have unique names.
===================
I use DMD 2.60 @ CentOS 6.3 32bit.
Best Regards,
Blazej Podsiadlo
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list