I noticed the calling "classinfo" on an interface returns the class info of the static type and not the dynamic type. Is that intentional? Perhaps because of COM and C++ interfaces?

module main;

import std.stdio;

interface Foo {}
class Bar : Foo {}

void main()
{
    Foo f = new Bar;
    writeln(f.classinfo);
}

The above program will print the static type "main.Foo" instead of the dynamic type "main.Bar".

--
/Jacob Carlborg

Reply via email to