[Issue 18916] ICE using Typedef and __LINE__

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 9 09:53:27 UTC 2018


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

--- Comment #2 from Mike Franklin <slavo5150 at yahoo.com> ---
Alternate test case that doesn't require Phobos.

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 == 12);
    assert(line2 == 21);
    assert(line3 == 12);
}

void main()
{
    foo();
}

--


More information about the Digitalmars-d-bugs mailing list