www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12641] New: D1: __FILE__ and __LINE__ default argument

https://issues.dlang.org/show_bug.cgi?id=12641

          Issue ID: 12641
           Summary: D1: __FILE__ and __LINE__ default argument behaviour
           Product: D
           Version: D1
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: public dicebot.lv

```D
import std.stdio;

void foo(long line = __LINE__)
{
    writefln("{}", line);
}

void main()
{
    foo();
}
```

This code currently prints "10" with D2 compiler and "3" with D1 one. That
forces to use lot of annoying boilerplate and is probably #1 feature to
backport in terms of ROI.

--
Apr 25 2014