Re: alias fails to compile

2019-04-22 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Monday, 22 April 2019 at 19:57:11 UTC, aliak wrote: On Monday, 22 April 2019 at 08:02:06 UTC, Arun Chandrasekaran wrote: 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

Re: alias fails to compile

2019-04-22 Thread aliak via Digitalmars-d-learn
On Monday, 22 April 2019 at 08:02:06 UTC, Arun Chandrasekaran wrote: 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

Re: alias fails to compile

2019-04-22 Thread Adam D. Ruppe via Digitalmars-d-learn
see this other thread for possible solutions too https://forum.dlang.org/post/anasidaotexgfkyiq...@forum.dlang.org

Re: alias fails to compile

2019-04-22 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Monday, 22 April 2019 at 14:07:11 UTC, Alex wrote: On Monday, 22 April 2019 at 08:02:06 UTC, Arun Chandrasekaran wrote: 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

Re: alias fails to compile

2019-04-22 Thread Alex via Digitalmars-d-learn
On Monday, 22 April 2019 at 08:02:06 UTC, Arun Chandrasekaran wrote: 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

Re: alias fails to compile

2019-04-22 Thread Stefan Koch via Digitalmars-d-learn
On Monday, 22 April 2019 at 08:02:06 UTC, Arun Chandrasekaran wrote: 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

alias fails to compile

2019-04-22 Thread Arun Chandrasekaran via Digitalmars-d-learn
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