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

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


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

Andrei Alexandrescu <andrei at erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei at erdani.com

--- Comment #1 from Andrei Alexandrescu <andrei at erdani.com> ---
There is a workaround to this:

struct R {
    int[] arr;

    alias get this;

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

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

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

--


More information about the Digitalmars-d-bugs mailing list