[Issue 453] New: When importing modules compiler can not distinguish between directory and file

Chris Nicholson-Sauls ibisbasenji at gmail.com
Tue Oct 24 22:06:05 PDT 2006


d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=453
> 
>            Summary: When importing modules compiler can not distinguish
>                     between directory and file
>            Product: D
>            Version: 0.169
>           Platform: Other
>         OS/Version: All
>             Status: NEW
>           Severity: normal
>           Priority: P2
>          Component: DMD
>         AssignedTo: bugzilla at digitalmars.com
>         ReportedBy: aarti at interia.pl
> 
> 
> ....
> 
> It cause problems when there is same name of file as a name of directory.
> 
> E.g. Directory:
> doost/program_options/a.d
> doost/program_options/b.d
> doost/program_options/c.d
> doost/program_options.d
> 
> Program:
> import doost.program_options;
> 
> Above cause error, although it is easy to see that I mean file not a directory
> (AFAIK last part of import is always file).
> 
> It's quite a basic problem, so I thing it should be corrected in the first
> place. It causes unnecessary problems when porting code from C++ and disallows
> creating program directory structure in the way designer wants.
> 
> 

This has come up many times before, and unless Walter has had a severe change of heart 
(and some genius insights) it won't be changing.  Allowing modules and packages to share a 
name introduces all manner of namespacing conflicts and ambiguities... effectively, 
imports break down entirely (particularly if any more naming conflicts occur deeper into 
the namespacing).

-- Chris Nicholson-Sauls



More information about the Digitalmars-d-bugs mailing list