www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Accessing this.outer at compile time?

Simplified test case:

class foo {
     class bar {
         pragma( msg, typeof( this.outer ).stringof );
     }
}

Test.d(3): Error: variable this forward referenced

While I understand I cannot do any operations on this.outer,
getting its type and reacting to that ought to be within the
realms of possibility. Now, the actual use case is a template
mixin that checks if 'this' is an inner class or not, so if
there is a known way to do that, it would suit my needs, but
this may still be worthy of a bug report, no?

-- 
Simen
Dec 02 2009