[Issue 18322] New: void fun(string file=__FILE_FULL_PATH__)() returns relative path (pointing to nowhere)
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jan 28 08:03:13 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18322
Issue ID: 18322
Summary: void fun(string file=__FILE_FULL_PATH__)() returns
relative path (pointing to nowhere)
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: timothee.cour2 at gmail.com
this is reminiscent of https://issues.dlang.org/show_bug.cgi?id=16640 but
different, and in fact worse since it returns a wrong relative path
dmd -Ifoo4 -run main.d
foo4/main.d #BUG: relative path pointing to nowhere
/path/to/main.d #OK: absolute path
files:
main.d
foo4/util.d
```
// main.d:
module main;
import util;
void main(){fun;}
// foo4/main.d:
module util;
void fun(string file1=__FILE_FULL_PATH__)(string file2=__FILE_FULL_PATH__){
import std.stdio;
writeln(file1); // BUG:relative path
writeln(file2); // OK
}
```
NOTE: calling it a regression because dmd 2.075 also returned a relative path
instead of absolute (which is wrong) but at least the relative path it returned
was correct instead of pointing to nowhere
--
More information about the Digitalmars-d-bugs
mailing list