get actual classinfo through an interface?

Ary Borenszweig ary at esperanto.org.ar
Thu Nov 22 04:18:14 PST 2007


Christopher Wright wrote:
> Robert Fraser wrote:
>> BC wrote:
>>> new question. since IInterface.classinfo returns IInterface, how to get
>>> the actual value of the concrete class?
>>>
>>
>> typeid.
>>
>> interface Foo { }
>> class Bar : Foo { }
>> // ...
>> Foo foo = new Bar();
>> TypeInfo ti = typeid(foo);
> 
> Error: foo is used as a type.

Probably

typeid(typeof(foo))


More information about the Digitalmars-d-learn mailing list