diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java index b71dcb6c230..d9933221332 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java @@ -354,6 +354,10 @@ public class InlineCodegen extends CallGenerator { parentCodegen ); + if (isLambda) { + codegen.propagateChildReifiedTypeParametersUsages(parentCodegen.getReifiedTypeParametersUsages()); + } + return createSMAPWithDefaultMapping(expression, parentCodegen.getOrCreateSourceMapper().getResultMappings()); } diff --git a/compiler/testData/codegen/boxInline/reified/kt6990.1.kt b/compiler/testData/codegen/boxInline/reified/kt6990.1.kt new file mode 100644 index 00000000000..c021d6991b9 --- /dev/null +++ b/compiler/testData/codegen/boxInline/reified/kt6990.1.kt @@ -0,0 +1,7 @@ +import test.* + +class OK + +fun box(): String { + return inlineMeIfYouCan()!! +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/reified/kt6990.2.kt b/compiler/testData/codegen/boxInline/reified/kt6990.2.kt new file mode 100644 index 00000000000..6b8ba9682cb --- /dev/null +++ b/compiler/testData/codegen/boxInline/reified/kt6990.2.kt @@ -0,0 +1,10 @@ +package test + +public inline fun inlineMeIfYouCan(): String? = + { + f { + T::class.java.getName() + } + }() + +inline fun f(x: () -> String) = x() \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java index 4e4114dd683..57898732e30 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java @@ -1090,6 +1090,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo doTestMultiFileWithInlineCheck(fileName); } + @TestMetadata("kt6990.1.kt") + public void testKt6990() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/kt6990.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + @TestMetadata("kt7017.1.kt") public void testKt7017() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/kt7017.1.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java index a949205b8a0..b448e38bd3d 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -1090,6 +1090,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi doBoxTestWithInlineCheck(fileName); } + @TestMetadata("kt6990.1.kt") + public void testKt6990() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/kt6990.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + @TestMetadata("kt7017.1.kt") public void testKt7017() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/kt7017.1.kt");