[Issue 18260] ICE on template this parameter and alias this

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 18 22:20:15 UTC 2018


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

--- Comment #2 from Andrei Alexandrescu <andrei at erdani.com> ---
A better workaround:

struct R {
    int[] arr;

    alias get this;

    This get(this This)()
    {
        return This.init;
    }
}

unittest
{
    const(R) b = const(R).init;
}

I suspect the problem is an infinite recursion during semantic checking.

--


More information about the Digitalmars-d-bugs mailing list