compiler support added for precise GC

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Tue Apr 17 18:11:10 PDT 2012


"Jacob Carlborg" <doob at me.com> wrote in message 
news:jmjb2v$1d2k$1 at digitalmars.com...
>
> What's not possible is when the runtime type is different from the static 
> type:
>
> class Base { ... }
> class Sub : Base { ... }
>
> Base b = new Sub;
>
> In the above code, when inspecting "b" using compile time reflection all 
> information about "Sub" is gone. It's just a regular "Base".
>

Can't you just query compile-time information to see what classes inherit 
from Base? Then you could just try downcasting to them.




More information about the Digitalmars-d mailing list