digitalmars.D.bugs - [Issue 8748] New: the module name must not be unique in the pack and its subpacks
- d-bugmail puremagic.com (73/73) Oct 03 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8748
- d-bugmail puremagic.com (14/14) Jan 11 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8748
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 puremagic.com ReportedBy: blazej.podsiadlo gmail.com 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 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: -------
Oct 03 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8748 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |andrej.mitrovich gmail.com Resolution| |INVALID 18:00:23 PST --- Import declarations are not C include statements, if you import 'foo.bar', then you must have a module with a declaration 'module foo.bar;', regardless of where it's located. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 11 2013