Bug? aliasing member of instance

Nick Sabalausky a at a.a
Sat Oct 22 00:28:53 PDT 2011


Is this a compiler bug?

--------------------------------
struct Foo
{
    int a;
}

Foo foo;
alias foo.a b;

void main()
{
    b = 5;  // <-- Error
}
--------------------------------

>dmd test.d
test.d(11): Error: need 'this' to access member a

I did this on DMD 2.055




More information about the Digitalmars-d-learn mailing list