From 2fedb97d16fd7a7ddddaa4c2b162dfe9d19e2b79 Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Mon, 3 Jan 2022 14:59:21 +0100 Subject: [PATCH] Correctly map nullable generic underlying value of inline class if upper bound is primitive type. #KT-32162 --- .../kotlin/types/AbstractTypeMapper.kt | 4 +- .../FirBlackBoxCodegenTestGenerated.java | 36 +++++++++++++ ...ClassUnderlyingTypeGenericWithInterface.kt | 34 +++++++++++++ ...lassUnderlyingTypeGenericWithInterface2.kt | 34 +++++++++++++ ...lassWithNullablePrimitiveUnderlyingType.kt | 28 +++++++++++ ...hNullablePrimitiveUnderlyingTypeGeneric.kt | 28 +++++++++++ ...itiveUnderlyingTypeGenericWithInterface.kt | 29 +++++++++++ ...tiveUnderlyingTypeGenericWithInterface2.kt | 29 +++++++++++ ...ClassWithPrimitiveUnderlyingTypeGeneric.kt | 2 +- .../codegen/BlackBoxCodegenTestGenerated.java | 36 +++++++++++++ .../IrBlackBoxCodegenTestGenerated.java | 36 +++++++++++++ .../LightAnalysisModeTestGenerated.java | 30 +++++++++++ .../kotlin/types/expandedTypeUtils.kt | 4 +- .../js/test/JsCodegenBoxTestGenerated.java | 36 +++++++++++++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 36 +++++++++++++ .../IrCodegenBoxWasmTestGenerated.java | 30 +++++++++++ .../NativeCodegenBoxTestGenerated.java | 50 ++++++++++++++++++- 17 files changed, 478 insertions(+), 4 deletions(-) create mode 100644 compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt create mode 100644 compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt diff --git a/compiler/backend.common.jvm/src/org/jetbrains/kotlin/types/AbstractTypeMapper.kt b/compiler/backend.common.jvm/src/org/jetbrains/kotlin/types/AbstractTypeMapper.kt index 390835f36b8..ac621bd602a 100644 --- a/compiler/backend.common.jvm/src/org/jetbrains/kotlin/types/AbstractTypeMapper.kt +++ b/compiler/backend.common.jvm/src/org/jetbrains/kotlin/types/AbstractTypeMapper.kt @@ -83,7 +83,9 @@ object AbstractTypeMapper { typeConstructor.isTypeParameter() -> { val typeParameter = typeConstructor.asTypeParameter() val upperBound = typeParameter.representativeUpperBound() - val newType = if (upperBound.typeConstructor().isInlineClass() && type.isNullableType()) + val upperBoundIsPrimitiveOrInlineClass = + upperBound.typeConstructor().isInlineClass() || upperBound is SimpleTypeMarker && upperBound.isPrimitiveType() + val newType = if (upperBoundIsPrimitiveOrInlineClass && type.isNullableType()) upperBound.makeNullable() else upperBound diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 6c7def71cb0..16fa3fc2bb6 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -21559,6 +21559,42 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingTypeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); } + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + @Test @TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt") public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception { diff --git a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt new file mode 100644 index 00000000000..3d9291f48dc --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt @@ -0,0 +1,34 @@ +// WITH_STDLIB +// WORKS_WHEN_VALUE_CLASS +// IGNORE_BACKEND: JVM +// LANGUAGE: +ValueClasses, +GenericInlineClassParameter + +class BoxT(val boxed: T) +class BoxAny(val boxed: Any?) +class BoxFoo(val boxed: IFoo?) + +interface IFoo + +interface Marker + +OPTIONAL_JVM_INLINE_ANNOTATION +value class IcInt(val i: Int): Marker + +OPTIONAL_JVM_INLINE_ANNOTATION +value class I32(val value: T?) : IFoo where T: IcInt + +fun boxToTypeParameter(x: I32?) where T: IcInt = BoxT(x) +fun boxToNullableAny(x: I32?) where T: IcInt = BoxAny(x) +fun boxToNullableInterface(x: I32?) where T: IcInt = BoxFoo(x) + +fun useNullableI32(x: I32?) where T: IcInt { + if (x != null) throw AssertionError() +} + +fun box(): String { + useNullableI32(boxToTypeParameter(null).boxed) + useNullableI32(boxToNullableAny(null).boxed as I32?) + useNullableI32(boxToNullableInterface(null).boxed as I32?) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt new file mode 100644 index 00000000000..ab8f4302374 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt @@ -0,0 +1,34 @@ +// WITH_STDLIB +// WORKS_WHEN_VALUE_CLASS +// IGNORE_BACKEND: JVM +// LANGUAGE: +ValueClasses, +GenericInlineClassParameter + +class BoxT(val boxed: T) +class BoxAny(val boxed: Any?) +class BoxFoo(val boxed: IFoo?) + +interface IFoo + +interface Marker + +OPTIONAL_JVM_INLINE_ANNOTATION +value class IcInt(val i: Int): Marker + +OPTIONAL_JVM_INLINE_ANNOTATION +value class I32(val value: T?) : IFoo where T: Marker + +fun boxToTypeParameter(x: I32?) where T: Marker = BoxT(x) +fun boxToNullableAny(x: I32?) where T: Marker = BoxAny(x) +fun boxToNullableInterface(x: I32?) where T: Marker = BoxFoo(x) + +fun useNullableI32(x: I32?) where T: Marker { + if (x != null) throw AssertionError() +} + +fun box(): String { + useNullableI32(boxToTypeParameter(null).boxed) + useNullableI32(boxToNullableAny(null).boxed as I32?) + useNullableI32(boxToNullableInterface(null).boxed as I32?) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt new file mode 100644 index 00000000000..4810886db99 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt @@ -0,0 +1,28 @@ +// WITH_STDLIB +// WORKS_WHEN_VALUE_CLASS +// LANGUAGE: +ValueClasses + +class BoxT(val boxed: T) +class BoxAny(val boxed: Any?) +class BoxFoo(val boxed: IFoo?) + +interface IFoo + +OPTIONAL_JVM_INLINE_ANNOTATION +value class I32(val value: Int?) : IFoo + +fun boxToTypeParameter(x: I32?) = BoxT(x) +fun boxToNullableAny(x: I32?) = BoxAny(x) +fun boxToNullableInterface(x: I32?) = BoxFoo(x) + +fun useNullableI32(x: I32?) { + if (x != null) throw AssertionError() +} + +fun box(): String { + useNullableI32(boxToTypeParameter(null).boxed) + useNullableI32(boxToNullableAny(null).boxed as I32?) + useNullableI32(boxToNullableInterface(null).boxed as I32?) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt new file mode 100644 index 00000000000..374b5f7b895 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt @@ -0,0 +1,28 @@ +// WITH_STDLIB +// WORKS_WHEN_VALUE_CLASS +// LANGUAGE: +ValueClasses, +GenericInlineClassParameter + +class BoxT(val boxed: T) +class BoxAny(val boxed: Any?) +class BoxFoo(val boxed: IFoo?) + +interface IFoo + +OPTIONAL_JVM_INLINE_ANNOTATION +value class I32(val value: T?) : IFoo + +fun boxToTypeParameter(x: I32?) = BoxT(x) +fun boxToNullableAny(x: I32?) = BoxAny(x) +fun boxToNullableInterface(x: I32?) = BoxFoo(x) + +fun useNullableI32(x: I32?) { + if (x != null) throw AssertionError() +} + +fun box(): String { + useNullableI32(boxToTypeParameter(null).boxed) + useNullableI32(boxToNullableAny(null).boxed as I32?) + useNullableI32(boxToNullableInterface(null).boxed as I32?) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt new file mode 100644 index 00000000000..a4421920638 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt @@ -0,0 +1,29 @@ +// WITH_STDLIB +// WORKS_WHEN_VALUE_CLASS +// IGNORE_BACKEND: JVM +// LANGUAGE: +ValueClasses, +GenericInlineClassParameter + +class BoxT(val boxed: T) +class BoxAny(val boxed: Any?) +class BoxFoo(val boxed: IFoo?) + +interface IFoo + +OPTIONAL_JVM_INLINE_ANNOTATION +value class I32(val value: T?) : IFoo where T: Comparable + +fun boxToTypeParameter(x: I32?) where T: Comparable = BoxT(x) +fun boxToNullableAny(x: I32?) where T: Comparable = BoxAny(x) +fun boxToNullableInterface(x: I32?) where T: Comparable = BoxFoo(x) + +fun useNullableI32(x: I32?) where T: Comparable { + if (x != null) throw AssertionError() +} + +fun box(): String { + useNullableI32(boxToTypeParameter(null).boxed) + useNullableI32(boxToNullableAny(null).boxed as I32?) + useNullableI32(boxToNullableInterface(null).boxed as I32?) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt new file mode 100644 index 00000000000..cd1316131f4 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt @@ -0,0 +1,29 @@ +// WITH_STDLIB +// WORKS_WHEN_VALUE_CLASS +// IGNORE_BACKEND: JVM +// LANGUAGE: +ValueClasses, +GenericInlineClassParameter + +class BoxT(val boxed: T) +class BoxAny(val boxed: Any?) +class BoxFoo(val boxed: IFoo?) + +interface IFoo + +OPTIONAL_JVM_INLINE_ANNOTATION +value class I32>(val value: T?) : IFoo where T: Int + +fun > boxToTypeParameter(x: I32?) where T: Int = BoxT(x) +fun > boxToNullableAny(x: I32?) where T: Int = BoxAny(x) +fun > boxToNullableInterface(x: I32?) where T: Int = BoxFoo(x) + +fun > useNullableI32(x: I32?) where T: Int { + if (x != null) throw AssertionError() +} + +fun box(): String { + useNullableI32(boxToTypeParameter(null).boxed) + useNullableI32(boxToNullableAny(null).boxed as I32?) + useNullableI32(boxToNullableInterface(null).boxed as I32?) + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingTypeGeneric.kt b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingTypeGeneric.kt index 374b5f7b895..e2014b2866b 100644 --- a/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingTypeGeneric.kt +++ b/compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingTypeGeneric.kt @@ -9,7 +9,7 @@ class BoxFoo(val boxed: IFoo?) interface IFoo OPTIONAL_JVM_INLINE_ANNOTATION -value class I32(val value: T?) : IFoo +value class I32(val value: T) : IFoo fun boxToTypeParameter(x: I32?) = BoxT(x) fun boxToNullableAny(x: I32?) = BoxAny(x) diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index ca85688abe2..6c7bcd82839 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -21133,6 +21133,42 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingTypeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); } + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + @Test @TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt") public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index f97956e5a13..459439d8a18 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -21559,6 +21559,42 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingTypeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); } + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + @Test @TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt") public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index afe7a2bcaa9..cd2abfb0514 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16003,6 +16003,26 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inlineClasses/toStringOfUnboxedNullableGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); } + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt") + public void ignoreUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt") + public void ignoreUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt") + public void ignoreUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt") + public void ignoreUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -17585,6 +17605,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingTypeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); } + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); + } + @TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt") public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal()); diff --git a/core/compiler.common.jvm/src/org/jetbrains/kotlin/types/expandedTypeUtils.kt b/core/compiler.common.jvm/src/org/jetbrains/kotlin/types/expandedTypeUtils.kt index fad5f158203..ca327f06b30 100644 --- a/core/compiler.common.jvm/src/org/jetbrains/kotlin/types/expandedTypeUtils.kt +++ b/core/compiler.common.jvm/src/org/jetbrains/kotlin/types/expandedTypeUtils.kt @@ -25,9 +25,11 @@ private fun TypeSystemCommonBackendContext.computeExpandedTypeInner( val upperBound = typeParameter.getRepresentativeUpperBound() computeExpandedTypeInner(upperBound, visitedClassifiers) ?.let { expandedUpperBound -> + val upperBoundIsPrimitiveOrInlineClass = + upperBound.typeConstructor().isInlineClass() || upperBound is SimpleTypeMarker && upperBound.isPrimitiveType() when { expandedUpperBound is SimpleTypeMarker && expandedUpperBound.isPrimitiveType() && - kotlinType.isNullableType() && upperBound.typeConstructor().isInlineClass() -> upperBound.makeNullable() + kotlinType.isNullableType() && upperBoundIsPrimitiveOrInlineClass -> upperBound.makeNullable() expandedUpperBound.isNullableType() || !kotlinType.isMarkedNullable() -> expandedUpperBound else -> expandedUpperBound.makeNullable() } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index dd454326286..6cbcb565a00 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -16707,6 +16707,42 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingTypeGeneric.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); } + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + @Test @TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt") public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index 9d17423d436..b79c42b7444 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -16671,6 +16671,42 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingTypeGeneric.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); } + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + @Test @TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt") public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index afe30400dfc..6cfb40ceaed 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -14037,6 +14037,36 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingTypeGeneric.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); } + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + } + @TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt") public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index e3d9912062e..7f46793a6d4 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -16248,6 +16248,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest register("compiler/testData/codegen/box/inlineClasses/UIntArraySortExampleGeneric.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); register("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingType.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); register("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingTypeGeneric.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + register("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + register("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + register("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + register("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + register("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); + register("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); register("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); register("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithPrimitiveUnderlyingTypeGeneric.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); register("compiler/testData/codegen/box/inlineClasses/unboxParameterOfSuspendLambdaBeforeInvoke.kt", TransformersFunctions.getRemoveOptionalJvmInlineAnnotation()); @@ -18340,6 +18346,48 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNonNullUnderlyingTypeGeneric.kt"); } + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface() throws Exception { + // There is a registered source transformer for the testcase: TransformersFunctions.getRemoveOptionalJvmInlineAnnotation() + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface.kt"); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2() throws Exception { + // There is a registered source transformer for the testcase: TransformersFunctions.getRemoveOptionalJvmInlineAnnotation() + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullableInlineClassUnderlyingTypeGenericWithInterface2.kt"); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType() throws Exception { + // There is a registered source transformer for the testcase: TransformersFunctions.getRemoveOptionalJvmInlineAnnotation() + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingType.kt"); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric() throws Exception { + // There is a registered source transformer for the testcase: TransformersFunctions.getRemoveOptionalJvmInlineAnnotation() + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGeneric.kt"); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface() throws Exception { + // There is a registered source transformer for the testcase: TransformersFunctions.getRemoveOptionalJvmInlineAnnotation() + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface.kt"); + } + + @Test + @TestMetadata("unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt") + public void testUnboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2() throws Exception { + // There is a registered source transformer for the testcase: TransformersFunctions.getRemoveOptionalJvmInlineAnnotation() + runTest("compiler/testData/codegen/box/inlineClasses/unboxNullableValueOfInlineClassWithNullablePrimitiveUnderlyingTypeGenericWithInterface2.kt"); + } + @Test @TestMetadata("unboxNullableValueOfInlineClassWithPrimitiveUnderlyingType.kt") public void testUnboxNullableValueOfInlineClassWithPrimitiveUnderlyingType() throws Exception { @@ -20553,7 +20601,7 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest @Nested @TestMetadata("compiler/testData/codegen/box/inlineClasses/genericUnderlyingValue") @TestDataPath("$PROJECT_ROOT") - @Tag("external") + @Tag("codegen") @UseExtTestCaseGroupProvider() public class GenericUnderlyingValue { @Test