December 03, 2009 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
|
Copyright © 1999-2021 by the D Language Foundation