alias fails to compile

Arun Chandrasekaran aruncxy at gmail.com
Mon Apr 22 08:02:06 UTC 2019


What am I doing wrong here?

struct A
{
     union B
     {
         int bb;
     }
     B b;
     alias aa = B.bb;
}

void main()
{
     A a = A();
     // a.b.bb = 4; // works
     a.aa = 4; // fails
}


https://run.dlang.io/is/kXaVy2


More information about the Digitalmars-d-learn mailing list