Bug 12641 – D1: __FILE__ and __LINE__ default argument behaviour

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2014-04-25T09:40:00Z
Last change time
2014-04-28T11:12:40Z
Keywords
industry
Assigned to
nobody
Creator
public

Comments

Comment #0 by public — 2014-04-25T09:40:25Z
```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.
Comment #1 by bugzilla — 2014-04-26T18:54:22Z
Comment #2 by leandro.lucarella — 2014-04-28T11:12:40Z
Thanks!