[Issue 14185] [ICE] [mtype.c] compiler segfault in in Type::aliasthisOf

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 12 03:47:05 PDT 2015


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

--- Comment #2 from Maxim Fomin <maxim-fomin at outlook.com> ---
struct Mutexed
{
    auto acquire ()
    {
        return Lock (this);
    }
    alias acquire this;

    struct Lock
    {
        Mutexed* source;
    }
}
void main ()
{
    Mutexed x;
}


if auto acquire () is changed to Lock or Lock* acquire() then dmd will emit
'cannot implicitly convert expression (this) of type Mutexed to Mutexed*
'. To fix error 'this' argument should be taken by pointer, so it is ice on
accepts-invalid.

--


More information about the Digitalmars-d-bugs mailing list