On Tuesday, 5 May 2015 at 04:09:03 UTC, Manfred Nowak wrote:
class C{
  override bool opEquals( Object o){
    return true;
  }
}
unittest{
  auto c= new C;
  assert( c == c);
}

`rdmd --main -unittest -cov' shows, that opEquals is not executed. Why?

-manfred

because `c is c`

https://github.com/D-Programming-Language/druntime/blob/0ac255d7276b9b825eb6f1e677e9ee4f5ad49ca2/src/object.di#L61

Reply via email to