From a9d686b9f9df05ced0053fe1cfd6522c360ef9dd Mon Sep 17 00:00:00 2001 From: Ivan Kylchik Date: Wed, 2 Sep 2020 18:56:26 +0300 Subject: [PATCH] Add outer object to stack when interpreting constructor of inner class --- .../src/org/jetbrains/kotlin/ir/interpreter/IrInterpreter.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/IrInterpreter.kt b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/IrInterpreter.kt index fb7f04c9060..af38f47306e 100644 --- a/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/IrInterpreter.kt +++ b/compiler/ir/ir.interpreter/src/org/jetbrains/kotlin/ir/interpreter/IrInterpreter.kt @@ -398,6 +398,10 @@ class IrInterpreter(private val irBuiltIns: IrBuiltIns, private val bodyMap: Map if (irClass.isInner) { constructorCall.dispatchReceiver!!.interpret().check { return it } state.outerClass = Variable(irClass.parentAsClass.thisReceiver!!.symbol, stack.popReturnValue()) + // used in case when inner class has inner super class + valueArguments.add(Variable(owner.dispatchReceiverParameter!!.symbol, state.outerClass!!.state)) + // used to get information from outer class + valueArguments.add(state.outerClass!!) } valueArguments.add(Variable(irClass.thisReceiver!!.symbol, state)) //used to set up fields in body return stack.newFrame(initPool = valueArguments + state.typeArguments) {