[Issue 7651] New: Cannot use object.d file in user projects
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Mar 5 10:03:21 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7651
Summary: Cannot use object.d file in user projects
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-03-05 10:03:20 PST ---
File structures:
foo\object.d:
module foo.object;
foo\main.d:
module foo.main;
import foo.object;
void main() {}
$ dmd -I.. main.d object.d
object.d: Error: module foo.object from file object.d conflicts with
another module object from file object.d
The issue is that druntime\import\object.di has this module declaration:
module object;
IOW, 'object.d' does not belong to a package and DMD simply refuses to compile
two modules together when one has a package name and the other has not.
Now I've never seen people use 'import object;' in D code before, so why not
move object.d into the core package instead of making it a packageless module?
I know it's "special", but "object" is a very common name and it will probably
conflict with other people's projects if they try to use a 'object.d' module of
some custom package in their code.
--
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