From 0f2937bae5c88cdc501da9e62404c2d542950f6d Mon Sep 17 00:00:00 2001 From: pyos Date: Mon, 30 Aug 2021 12:27:40 +0200 Subject: [PATCH] JVM_IR: use nullability when boxing/unboxing inline class types Given inline class V(Any?), a coercion from (Object, V) to (Object, V?) is boxing. In theory, the same issue in the old backend can be fixed by making `KotlinTypeMapper.mapUnderlyingTypeOfInlineClassType` use `computeExpandedTypeForInlineClass`, but for some reason this breaks a lot of stuff. #KT-48430 Fixed --- .../kotlin/codegen/LightAnalysisModeTestGenerated.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index e0975ba0950..5593003b682 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -15222,6 +15222,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inlineClasses/boxImplDoesNotExecuteInitBlock.kt"); } + @TestMetadata("boxNullableForFakeOverride.kt") + public void testBoxNullableForFakeOverride() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/boxNullableForFakeOverride.kt"); + } + @TestMetadata("boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt") public void testBoxNullableValueOfInlineClassWithNonNullUnderlyingType() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/boxNullableValueOfInlineClassWithNonNullUnderlyingType.kt");