On Wed, Jul 30, 2008 at 3:06 AM, Frank Benoit <keinfarbton@googlemail.com> wrote:
interface I {
}
class C : I {
override int opEquals(Object o){
writefln("opEquals");
return true;
}
}
void main(){
I i1 = new C;
I i2 = new C;
bool a = ( i1 == i2 );
writefln( "result %s", a );
}
prints
result false
This is highly unexpected.
Sure one might understand that with the knowledge of interface/class incompatibility in D. But this shows once more, that D has a Bug here.
What is the reason that COM interfaces need to pretend to be D interfaces in the first place? As opposed to some special COMInterface type. I can't really think of any situation where you would need to treat a COM interface and a regular interface the same way without knowing that one was a COM interface. Or at least in a way that it would matter. For instance you could write a template that takes either a COM interface or a D interface, but in that case you generally won't care what the thing is underneath.
Can someone enlighten me? I've never really been able to understand what problem is supposed to be solved by conflating D Interfaces and COM interfaces.
--bb