D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11200 - RDMD adds import switch to dir name of first module, causing symbol clashes
Summary: RDMD adds import switch to dir name of first module, causing symbol clashes
Status: RESOLVED LATER
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-08 12:14 UTC by Andrej Mitrovic
Modified: 2021-01-24 07:20 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2013-10-08 12:14:54 UTC
Modules:

foo/bar.d:
-----
module foo.bar;

import foo.std.exception;
import std.range;
-----

foo/std/exception.d:
-----
module foo.std.exception;
-----

Compiling from path where the "foo" folder is located in:

$ dmd -main foo\bar.d
> 

$ rdmd -main foo\bar.d
C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\conv.d(26): Error: module foo.std.exception from file foo\std\exception.d must be imported as module 'foo.std.exception'
Comment 1 Andrej Mitrovic 2013-10-08 12:17:30 UTC
I can see the problem, RDMD automatically adds the foo folder to the import list for some bizarre reason..:

$ rdmd --chatty -main foo\bar.d
^"dmd^" ^"-main^" ^"-v^" ^"-o-^" ^"foo\bar.d^" ^"-Ifoo^"

I should not add that import switch.
Comment 2 Andrej Mitrovic 2013-10-08 12:17:39 UTC
(In reply to comment #1)
> I can see the problem, RDMD automatically adds the foo folder to the import
> list for some bizarre reason..:
> 
> $ rdmd --chatty -main foo\bar.d
> ^"dmd^" ^"-main^" ^"-v^" ^"-o-^" ^"foo\bar.d^" ^"-Ifoo^"
> 
> I should not add that import switch.

*It*
Comment 3 mhh 2021-01-24 07:20:18 UTC
Arguably beyond the scope of what rdmd is supposed to be for