www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - alias foo.bar this?

reply Lutger <lutger.blijdestijn gmail.com> writes:
The following doesn't compile, I was wondering whether this is a temporary 
limitation, bug or by design? 

struct Bar
{
    int baz;
}

struct Foo
{
    Bar bar;
    alias bar.baz this; // error
}
Aug 21 2009
parent Bill Baxter <wbaxter gmail.com> writes:
On Fri, Aug 21, 2009 at 2:47 AM, Lutger<lutger.blijdestijn gmail.com> wrote=
:
 The following doesn't compile, I was wondering whether this is a temporar=
y
 limitation, bug or by design?

 struct Bar
 {
 =A0 =A0int baz;
 }

 struct Foo
 {
 =A0 =A0Bar bar;
 =A0 =A0alias bar.baz this; // error
 }
Problem I would guess is that bar.baz is an expression and you can't alias expressions in any context. alias bar.baz that; doesn't work either. --bb
Aug 21 2009