mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00

The parser now always creates AST nodes for default init expressions like __FILE__. They are replaced in resolveLoc. Variable inDefaultArg in Scope is used, so the nodes are not replaced too early.
22 lines
298 B
D
22 lines
298 B
D
struct Line
|
|
{
|
|
int line;
|
|
alias line this;
|
|
|
|
this(int line)
|
|
{
|
|
this.line = line;
|
|
}
|
|
}
|
|
|
|
void foo(Line line1 = __LINE__, int line2 = __LINE__, int line3 = int(__LINE__))
|
|
{
|
|
assert(line1 == 21);
|
|
assert(line2 == 21);
|
|
assert(line3 == 21);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
foo();
|
|
}
|