The .outer property
Iain Buclaw
ibuclaw at ubuntu.com
Sat Mar 5 04:11:59 PST 2011
Is this behaviour correct? Should it even be legal to blindly allow access to
members/fields via the .outer context pointer (that may not even be there as
shown in this instance)?
class Outer
{
int w = 3;
void method()
{
int x = 4;
new class Object
{
this()
{
assert(w == 3); // Passes
//assert(x == 4); // Passes
assert(this.outer.w == 3); // Fails if above is uncommented
}
};
}
}
Regards
More information about the Digitalmars-d
mailing list