diff --git a/gen/toir.cpp b/gen/toir.cpp index 2b763a9a..4ec1eba6 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -1288,9 +1288,11 @@ DValue* EqualExp::toElem(IRState* p) LLValue* eval = 0; - if (t->isintegral() || t->ty == Tpointer) + // the Tclass catches interface comparisons, regular + // class equality should be rewritten as a.opEquals(b) by this time + if (t->isintegral() || t->ty == Tpointer || t->ty == Tclass) { - Logger::println("integral or pointer"); + Logger::println("integral or pointer or interface"); llvm::ICmpInst::Predicate cmpop; switch(op) {