From dbea244b0e0ac9e7c4a78657d2be10121476f203 Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Wed, 29 Mar 2017 19:19:40 +0300 Subject: [PATCH] Fixed bug with type substitution for reified type parameter --- .../jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt index 810b3e0d650..e9a7cf578a9 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt @@ -240,7 +240,9 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoid( val operandTypeDescriptor = newExpression.typeOperand.constructor.declarationDescriptor if (operandTypeDescriptor !is TypeParameterDescriptor) return newExpression // It is not TypeParameter - do nothing - val typeNew = typeArgsMap[operandTypeDescriptor]!! + var typeNew = typeArgsMap[operandTypeDescriptor]!! + if (newExpression.typeOperand.isMarkedNullable) + typeNew = typeNew.makeNullable() val startOffset = newExpression.startOffset val endOffset = newExpression.endOffset val operator = newExpression.operator