diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/SecondaryCtorLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/SecondaryCtorLowering.kt index 2a2be12dfe3..ff9c29d5403 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/SecondaryCtorLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/SecondaryCtorLowering.kt @@ -24,10 +24,7 @@ import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl -import org.jetbrains.kotlin.ir.util.deepCopyWithSymbols -import org.jetbrains.kotlin.ir.util.defaultType -import org.jetbrains.kotlin.ir.util.isSubclassOf -import org.jetbrains.kotlin.ir.util.parentAsClass +import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid @@ -282,11 +279,11 @@ private class CallsiteRedirectionTransformer(private val context: JsIrBackendCon } val readThis = expression.run { - if (data!! is IrConstructor) { - val thisReceiver = klass.thisReceiver!! + if (data is IrConstructor) { + val thisReceiver = data.constructedClass.thisReceiver!! IrGetValueImpl(startOffset, endOffset, thisReceiver.type, thisReceiver.symbol) } else { - val lastValueParameter = data.valueParameters.last() + val lastValueParameter = data!!.valueParameters.last() IrGetValueImpl(startOffset, endOffset, lastValueParameter.type, lastValueParameter.symbol) } }