From abbcf61183cf9ef13ba34cca92d3418531411a9b Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 8 Dec 2014 18:31:47 +0300 Subject: [PATCH] JVM Backend: always inline callable containing reified TP --- .../src/org/jetbrains/jet/codegen/ExpressionCodegen.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index d72b473471b..e6e7e926d0c 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -2283,7 +2283,9 @@ public class ExpressionCodegen extends JetVisitor implem ) { if (callElement == null) return defaultCallGenerator; - boolean isInline = state.isInlineEnabled() && + // We should inline callable containing reified type parameters even if inline is disabled + // because they may contain something to reify and straight call will probably fail at runtime + boolean isInline = (state.isInlineEnabled() || DescriptorUtils.containsReifiedTypeParameters(descriptor)) && descriptor instanceof SimpleFunctionDescriptor && ((SimpleFunctionDescriptor) descriptor).getInlineStrategy().isInline();