Accessing this.outer at compile time?

Simen kjaeraas simen.kjaras at gmail.com
Wed Dec 2 19:30:54 PST 2009


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


More information about the Digitalmars-d-learn mailing list