Comparing interfaces does not call opEquals

Frank Benoit keinfarbton at googlemail.com
Tue Jul 29 11:06:48 PDT 2008


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.






More information about the Digitalmars-d mailing list