You are using typeid() comparison incorrectly (no fault of yours, the
spec is erroneous, see http://d.puremagic.com/issues/show_bug.cgi?id=373 ).
Using '==' to compare TypeInfos will test the equality of the type's
"archetype", that is, if they are both a struct, a pointer, a class,
etc. Apparently interfaces and classes belong to the same archetype
(which is class), so any TypeInfo equality comparison between any of
these will allways result true.
Using 'is' to compare TypeInfos will test for an exact type match, which
is also not what you, since it will disregard polymorphism.
Here's how you can do it:
// Check for class archetype:
if( _arguments[i] == typeid(Object) ) {
auto obj = va_arg!(Object)(_argptr);
// check if obj is-a I
if( (cast(I) obj) != null ) {
I myi = cast(I) obj;
// use myi
writefln(myi.f());
}
}
--
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D

You are using typeid() comparison incorrectly (no fault of yours, the
spec is erroneous, see http://d.puremagic.com/issues/show_bug.cgi?id=373 ).
Using '==' to compare TypeInfos will test the equality of the type's
"archetype", that is, if they are both a struct, a pointer, a class,
etc. Apparently interfaces and classes belong to the same archetype
(which is class), so any TypeInfo equality comparison between any of
these will allways result true.
Using 'is' to compare TypeInfos will test for an exact type match, which
is also not what you, since it will disregard polymorphism.
Here's how you can do it:
// Check for class archetype:
if( _arguments[i] == typeid(Object) ) {
auto obj = va_arg!(Object)(_argptr);
// check if obj is-a I
if( (cast(I) obj) != null ) {
I myi = cast(I) obj;
// use myi
writefln(myi.f());
}
}