[Issue 12339] "alais this" not considered for qualified conversion

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 10 12:31:47 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12339


Maxim Fomin <maxim at maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim at maxim-fomin.ru


--- Comment #1 from Maxim Fomin <maxim at maxim-fomin.ru> 2014-03-10 12:31:44 PDT ---
I think it does not work because struct contains pointer. If you comment out
it, it will work.

Note that dispite you alias to S type, S itself contains indirections.

//alias T = int; //OK
//alias T = S;   //FAIL
alias T = SS; // OK
static struct S
{
    int* p;
    T asMutable() const { return T(); }
    alias asMutable this;
}

struct SS
{
}

void main()
{
    immutable S s;
    T ss = s;
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list