Bug in -J

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 11 23:06:33 PDT 2017


On Saturday, 12 August 2017 at 06:02:57 UTC, Vladimir Panteleev 
wrote:
> Sounds reasonable, the compiler could check if paths start with 
> a -J path.

There is a potential ambiguity here:

dmd -Jsomedir test.d

test.d: import("somedir/file.txt");

Does the user mean to import "somedir/file.txt" or 
"somedir/somedir/file.txt"? Currently the latter is understood. 
Simply checking for path prefix would break this case. I guess 
this could be done only with absolute paths, but that introduces 
an inconsistency with relative paths. I'm not sure it's worth it, 
considering it's easy to work around.



More information about the Digitalmars-d mailing list