From bdfe82cfff8209fe23927019ffb2504dca1c5013 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 1 Apr 2019 19:21:10 +0200 Subject: [PATCH] Fix incorrect condition in CheckIrElementVisitor.ensureTypeIs Apparently it has no effect on behavior of tests because no backend uses the checkTypes mode of IR validation --- .../jetbrains/kotlin/backend/common/CheckIrElementVisitor.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/CheckIrElementVisitor.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/CheckIrElementVisitor.kt index dd8620a80ec..831b3f44a1f 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/CheckIrElementVisitor.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/CheckIrElementVisitor.kt @@ -53,8 +53,7 @@ class CheckIrElementVisitor( if (!config.checkTypes) return - // TODO: compare IR types instead. - if (expectedType.isEqualTo(type)) { + if (!expectedType.isEqualTo(type)) { reportError(this, "unexpected expression.type: expected $expectedType, got ${type.render()}") } }