[Issue 2887] Wrong line number reported inside string mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 3 08:35:07 UTC 2018


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

Seb <greensunny12 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12 at gmail.com
            Version|D1 (retired)                |D2

--- Comment #3 from Seb <greensunny12 at gmail.com> ---
Changing this to D2 as it's still not working as expected:

---
template line()
{
        const char[] line = "__LINE__";
}
template wrongLine()
{
        const char[] wrongLine = "\n\n\n\n\n__LINE__";
}
void main()
{
    import std.stdio;
        writefln("Line: %s, %s, %s", __LINE__, mixin(line!()),
mixin(wrongLine!()));
        writefln("Line: %s, %s, %s", __LINE__, mixin(line!()),
mixin(wrongLine!()));
}
---


https://run.dlang.io/is/uZrbxu

--


More information about the Digitalmars-d-bugs mailing list