From 1e08b3c7da5f5621b6cf1e50c70a38d5a54ac41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20Sch=C3=A4fer?= Date: Tue, 30 Apr 2019 13:23:58 +0200 Subject: [PATCH] Simplify findLocalIndex in ExpressionCodegen --- .../kotlin/backend/jvm/codegen/ExpressionCodegen.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt index fb4f12822b7..8551b43b136 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt @@ -463,12 +463,8 @@ class ExpressionCodegen( private fun findLocalIndex(irSymbol: IrSymbol): Int { val index = frameMap.getIndex(irSymbol) - if (index >= 0) { + if (index >= 0) return index - } - if (irFunction.dispatchReceiverParameter != null && (irFunction.parent as? IrClass)?.thisReceiver?.symbol == irSymbol) { - return 0 - } val dump = if (irSymbol.isBound) irSymbol.owner.dump() else irSymbol.descriptor.toString() throw AssertionError("Non-mapped local declaration: $dump\n in ${irFunction.dump()}") }