TypeInfo of interfaces bugg or feature?

Adam D. Ruppe destructionator at gmail.com
Fri Dec 20 15:23:16 PST 2013


On Friday, 20 December 2013 at 21:21:16 UTC, TheFlyingFiddle 
wrote:
> Is this intended or is it a bug?

Intended, because an interface is not necessarily an Object. It 
might also be a COM object or a C++ object, and the typeinfo may 
not be available for them. (I think, maybe it would be from the 
.di file at least, but it is a different root anyway).

If you cast to Object then do typeid, you'll get the typeinfo you 
expect. (or null if it isn't a D Object)


More information about the Digitalmars-d-learn mailing list