diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt index 9bbb1bacfe5..6133d05879c 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt @@ -251,7 +251,8 @@ class GenerationState private constructor( val isInlineDisabled: Boolean = configuration.getBoolean(CommonConfigurationKeys.DISABLE_INLINE) val useTypeTableInSerializer: Boolean = configuration.getBoolean(JVMConfigurationKeys.USE_TYPE_TABLE) val unifiedNullChecks: Boolean = languageVersionSettings.apiVersion >= ApiVersion.KOTLIN_1_4 - val functionsWithInlineClassReturnTypesMangled: Boolean = languageVersionSettings.apiVersion >= ApiVersion.KOTLIN_1_4 + val functionsWithInlineClassReturnTypesMangled: Boolean = + languageVersionSettings.supportsFeature(LanguageFeature.MangleClassMembersReturningInlineClasses) val rootContext: CodegenContext<*> = RootContext(this) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt index a6d6395d32c..635e0976f27 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt @@ -619,6 +619,9 @@ class KotlinTypeMapper @JvmOverloads constructor( } } + private val shouldMangleByReturnType = + languageVersionSettings.supportsFeature(LanguageFeature.MangleClassMembersReturningInlineClasses) + private fun mangleMemberNameIfRequired( name: String, descriptor: CallableMemberDescriptor, @@ -657,7 +660,7 @@ class KotlinTypeMapper @JvmOverloads constructor( // so that we don't have to repeat the same logic in reflection // in case of properties without getter methods. if (kind !== OwnerKind.PROPERTY_REFERENCE_SIGNATURE || descriptor.isPropertyWithGetterSignaturePresent()) { - val suffix = getManglingSuffixBasedOnKotlinSignature(descriptor) + val suffix = getManglingSuffixBasedOnKotlinSignature(descriptor, shouldMangleByReturnType) if (suffix != null) { newName += suffix } else if (kind === OwnerKind.ERASED_INLINE_CLASS) { @@ -683,6 +686,7 @@ class KotlinTypeMapper @JvmOverloads constructor( } else newName } + private fun CallableMemberDescriptor.isPropertyWithGetterSignaturePresent(): Boolean { val propertyDescriptor = when (this) { is PropertyDescriptor -> this diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/inlineClassManglingUtils.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/inlineClassManglingUtils.kt index de2f1272cf8..de85ad43b88 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/inlineClassManglingUtils.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/inlineClassManglingUtils.kt @@ -16,7 +16,10 @@ import org.jetbrains.kotlin.types.typeUtil.representativeUpperBound import java.security.MessageDigest import java.util.* -fun getManglingSuffixBasedOnKotlinSignature(descriptor: CallableMemberDescriptor): String? { +fun getManglingSuffixBasedOnKotlinSignature( + descriptor: CallableMemberDescriptor, + shouldMangleByReturnType: Boolean +): String? { if (descriptor !is FunctionDescriptor) return null if (descriptor is ConstructorDescriptor) return null if (InlineClassDescriptorResolver.isSynthesizedBoxOrUnboxMethod(descriptor)) return null @@ -30,9 +33,11 @@ fun getManglingSuffixBasedOnKotlinSignature(descriptor: CallableMemberDescriptor // If a class member function returns inline class value, mangle its name. // NB here function can be a suspend function JVM view with return type replaced with 'Any', // should unwrap it and take original return type instead. - val unwrappedDescriptor = descriptor.unwrapInitialDescriptorForSuspendFunction() - if (requiresFunctionNameManglingForReturnType(unwrappedDescriptor)) { - return "-" + md5base64(":" + getSignatureElementForMangling(unwrappedDescriptor.returnType!!)) + if (shouldMangleByReturnType) { + val unwrappedDescriptor = descriptor.unwrapInitialDescriptorForSuspendFunction() + if (requiresFunctionNameManglingForReturnType(unwrappedDescriptor)) { + return "-" + md5base64(":" + getSignatureElementForMangling(unwrappedDescriptor.returnType!!)) + } } return null } diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 5773d65ece4..284fb53fba6 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -12978,6 +12978,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt"); } + @TestMetadata("noReturnTypeMangling.kt") + public void testNoReturnTypeMangling() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt"); + } + @TestMetadata("nullableEqeqNonNull.kt") public void testNullableEqeqNonNull() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt"); diff --git a/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt b/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt new file mode 100644 index 00000000000..63b18618ac9 --- /dev/null +++ b/compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt @@ -0,0 +1,13 @@ +// !LANGUAGE: +InlineClasses -MangleClassMembersReturningInlineClasses + +inline class S(val x: String) + +class Test { + fun getO() = S("O") + val k = S("K") +} + +fun box(): String { + val t = Test() + return t.getO().x + t.k.x +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingFun.kt b/compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingFun.kt new file mode 100644 index 00000000000..1c16a30f37d --- /dev/null +++ b/compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingFun.kt @@ -0,0 +1,16 @@ +// !LANGUAGE: +InlineClasses -MangleClassMembersReturningInlineClasses + +// FILE: 1.kt + +package test + +inline class S(val string: String) + +inline fun foo() = S("OK") + +// FILE: 2.kt + +import test.* + +fun box() : String = + foo().string diff --git a/compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingVal.kt b/compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingVal.kt new file mode 100644 index 00000000000..527d441a48c --- /dev/null +++ b/compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingVal.kt @@ -0,0 +1,16 @@ +// !LANGUAGE: +InlineClasses -MangleClassMembersReturningInlineClasses + +// FILE: 1.kt + +package test + +inline class S(val string: String) + +inline val foo get() = S("OK") + + +// FILE: 2.kt + +import test.* + +fun box() : String = foo.string diff --git a/compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingFun.kt b/compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingFun.kt new file mode 100644 index 00000000000..6073f8ac1cf --- /dev/null +++ b/compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingFun.kt @@ -0,0 +1,16 @@ +// !LANGUAGE: +InlineClasses +MangleClassMembersReturningInlineClasses + +// FILE: 1.kt + +package test + +inline class S(val string: String) + +inline fun foo() = S("OK") + +// FILE: 2.kt + +import test.* + +fun box() : String = + foo().string diff --git a/compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingVal.kt b/compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingVal.kt new file mode 100644 index 00000000000..c860e61851c --- /dev/null +++ b/compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingVal.kt @@ -0,0 +1,16 @@ +// !LANGUAGE: +InlineClasses +MangleClassMembersReturningInlineClasses + +// FILE: 1.kt + +package test + +inline class S(val string: String) + +inline val foo get() = S("OK") + + +// FILE: 2.kt + +import test.* + +fun box() : String = foo.string diff --git a/compiler/testData/codegen/bytecodeText/inlineClasses/noReturnTypeMangling.kt b/compiler/testData/codegen/bytecodeText/inlineClasses/noReturnTypeMangling.kt new file mode 100644 index 00000000000..3a0e45161fe --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/inlineClasses/noReturnTypeMangling.kt @@ -0,0 +1,17 @@ +// !LANGUAGE: +InlineClasses -MangleClassMembersReturningInlineClasses +// IGNORE_BACKEND: JVM_IR + +inline class S(val x: String) + +class Test { + fun getO() = S("O") + val k = S("K") +} + +fun box(): String { + val t = Test() + return t.getO().x + t.k.x +} + +// 1 public final getO\(\)Ljava/lang/String; +// 1 public final getK\(\)Ljava/lang/String; \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index f60648aa48f..da8f056ac15 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -14193,6 +14193,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt"); } + @TestMetadata("noReturnTypeMangling.kt") + public void testNoReturnTypeMangling() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt"); + } + @TestMetadata("nullableEqeqNonNull.kt") public void testNullableEqeqNonNull() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 2a3bcd08c89..8bfd60cacb2 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -1890,6 +1890,26 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo public void testInlineFunctionInsideInlineClassesBox() throws Exception { runTest("compiler/testData/codegen/boxInline/inlineClasses/inlineFunctionInsideInlineClassesBox.kt"); } + + @TestMetadata("noReturnTypeManglingFun.kt") + public void testNoReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingFun.kt"); + } + + @TestMetadata("noReturnTypeManglingVal.kt") + public void testNoReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingVal.kt"); + } + + @TestMetadata("withReturnTypeManglingFun.kt") + public void testWithReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingFun.kt"); + } + + @TestMetadata("withReturnTypeManglingVal.kt") + public void testWithReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingVal.kt"); + } } @TestMetadata("compiler/testData/codegen/boxInline/innerClasses") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java index a85cbd64fce..78c0ac37993 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java @@ -2951,6 +2951,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate.kt"); } + @TestMetadata("noReturnTypeMangling.kt") + public void testNoReturnTypeMangling() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noReturnTypeMangling.kt"); + } + @TestMetadata("nonOverridingMethodsAreCalledByInlineClass.kt") public void testNonOverridingMethodsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/nonOverridingMethodsAreCalledByInlineClass.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index f4619e0d1bd..45b8cfdda9a 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -1890,6 +1890,26 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi public void testInlineFunctionInsideInlineClassesBox() throws Exception { runTest("compiler/testData/codegen/boxInline/inlineClasses/inlineFunctionInsideInlineClassesBox.kt"); } + + @TestMetadata("noReturnTypeManglingFun.kt") + public void testNoReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingFun.kt"); + } + + @TestMetadata("noReturnTypeManglingVal.kt") + public void testNoReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingVal.kt"); + } + + @TestMetadata("withReturnTypeManglingFun.kt") + public void testWithReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingFun.kt"); + } + + @TestMetadata("withReturnTypeManglingVal.kt") + public void testWithReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingVal.kt"); + } } @TestMetadata("compiler/testData/codegen/boxInline/innerClasses") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 06603b859a9..beda7597354 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -14198,6 +14198,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt"); } + @TestMetadata("noReturnTypeMangling.kt") + public void testNoReturnTypeMangling() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt"); + } + @TestMetadata("nullableEqeqNonNull.kt") public void testNullableEqeqNonNull() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index 0ede77e0b2f..e1bac8cd49d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -12978,6 +12978,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt"); } + @TestMetadata("noReturnTypeMangling.kt") + public void testNoReturnTypeMangling() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt"); + } + @TestMetadata("nullableEqeqNonNull.kt") public void testNullableEqeqNonNull() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 85fc0589eeb..0b544572b20 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -1890,6 +1890,26 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli public void testInlineFunctionInsideInlineClassesBox() throws Exception { runTest("compiler/testData/codegen/boxInline/inlineClasses/inlineFunctionInsideInlineClassesBox.kt"); } + + @TestMetadata("noReturnTypeManglingFun.kt") + public void testNoReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingFun.kt"); + } + + @TestMetadata("noReturnTypeManglingVal.kt") + public void testNoReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingVal.kt"); + } + + @TestMetadata("withReturnTypeManglingFun.kt") + public void testWithReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingFun.kt"); + } + + @TestMetadata("withReturnTypeManglingVal.kt") + public void testWithReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingVal.kt"); + } } @TestMetadata("compiler/testData/codegen/boxInline/innerClasses") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java index 6c199b997ab..3939d6967f4 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java @@ -3036,6 +3036,11 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate.kt"); } + @TestMetadata("noReturnTypeMangling.kt") + public void testNoReturnTypeMangling() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noReturnTypeMangling.kt"); + } + @TestMetadata("nonOverridingMethodsAreCalledByInlineClass.kt") public void testNonOverridingMethodsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/nonOverridingMethodsAreCalledByInlineClass.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index bfe4315af94..2ea226ad0cb 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -1890,6 +1890,26 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC public void testInlineFunctionInsideInlineClassesBox() throws Exception { runTest("compiler/testData/codegen/boxInline/inlineClasses/inlineFunctionInsideInlineClassesBox.kt"); } + + @TestMetadata("noReturnTypeManglingFun.kt") + public void testNoReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingFun.kt"); + } + + @TestMetadata("noReturnTypeManglingVal.kt") + public void testNoReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingVal.kt"); + } + + @TestMetadata("withReturnTypeManglingFun.kt") + public void testWithReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingFun.kt"); + } + + @TestMetadata("withReturnTypeManglingVal.kt") + public void testWithReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingVal.kt"); + } } @TestMetadata("compiler/testData/codegen/boxInline/innerClasses") diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index c3c9b5c5a76..aee09b0ae43 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -124,6 +124,7 @@ enum class LanguageFeature( ProperIeee754Comparisons(KOTLIN_1_4, kind = BUG_FIX), FunctionalInterfaceConversion(KOTLIN_1_4, kind = UNSTABLE_FEATURE), GenerateJvmOverloadsAsFinal(KOTLIN_1_4), + MangleClassMembersReturningInlineClasses(KOTLIN_1_4), ProhibitSpreadOnSignaturePolymorphicCall(KOTLIN_1_5, kind = BUG_FIX), ProhibitInvisibleAbstractMethodsInSuperclasses(KOTLIN_1_5, kind = BUG_FIX), diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 850a7c7f4d7..c67f6532368 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -11168,6 +11168,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt"); } + @TestMetadata("noReturnTypeMangling.kt") + public void testNoReturnTypeMangling() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt"); + } + @TestMetadata("nullableEqeqNonNull.kt") public void testNullableEqeqNonNull() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenInlineES6TestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenInlineES6TestGenerated.java index 194b73c9e41..7f8a049241d 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenInlineES6TestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenInlineES6TestGenerated.java @@ -1690,6 +1690,26 @@ public class IrJsCodegenInlineES6TestGenerated extends AbstractIrJsCodegenInline public void testInlineFunctionInsideInlineClassesBox() throws Exception { runTest("compiler/testData/codegen/boxInline/inlineClasses/inlineFunctionInsideInlineClassesBox.kt"); } + + @TestMetadata("noReturnTypeManglingFun.kt") + public void testNoReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingFun.kt"); + } + + @TestMetadata("noReturnTypeManglingVal.kt") + public void testNoReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingVal.kt"); + } + + @TestMetadata("withReturnTypeManglingFun.kt") + public void testWithReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingFun.kt"); + } + + @TestMetadata("withReturnTypeManglingVal.kt") + public void testWithReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingVal.kt"); + } } @TestMetadata("compiler/testData/codegen/boxInline/innerClasses") diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index f1c1bcd2fcd..94a2d65b3f3 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -11178,6 +11178,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt"); } + @TestMetadata("noReturnTypeMangling.kt") + public void testNoReturnTypeMangling() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt"); + } + @TestMetadata("nullableEqeqNonNull.kt") public void testNullableEqeqNonNull() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java index ea162f23572..07db99a2f93 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java @@ -1690,6 +1690,26 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes public void testInlineFunctionInsideInlineClassesBox() throws Exception { runTest("compiler/testData/codegen/boxInline/inlineClasses/inlineFunctionInsideInlineClassesBox.kt"); } + + @TestMetadata("noReturnTypeManglingFun.kt") + public void testNoReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingFun.kt"); + } + + @TestMetadata("noReturnTypeManglingVal.kt") + public void testNoReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingVal.kt"); + } + + @TestMetadata("withReturnTypeManglingFun.kt") + public void testWithReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingFun.kt"); + } + + @TestMetadata("withReturnTypeManglingVal.kt") + public void testWithReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingVal.kt"); + } } @TestMetadata("compiler/testData/codegen/boxInline/innerClasses") diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 0093281e76d..e532e3e227f 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -11243,6 +11243,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inlineClasses/noAssertionsOnInlineClassBasedOnNullableType.kt"); } + @TestMetadata("noReturnTypeMangling.kt") + public void testNoReturnTypeMangling() throws Exception { + runTest("compiler/testData/codegen/box/inlineClasses/noReturnTypeMangling.kt"); + } + @TestMetadata("nullableEqeqNonNull.kt") public void testNullableEqeqNonNull() throws Exception { runTest("compiler/testData/codegen/box/inlineClasses/nullableEqeqNonNull.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java index 57bee3101e7..3b1dba2cfa6 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java @@ -1690,6 +1690,26 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest { public void testInlineFunctionInsideInlineClassesBox() throws Exception { runTest("compiler/testData/codegen/boxInline/inlineClasses/inlineFunctionInsideInlineClassesBox.kt"); } + + @TestMetadata("noReturnTypeManglingFun.kt") + public void testNoReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingFun.kt"); + } + + @TestMetadata("noReturnTypeManglingVal.kt") + public void testNoReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/noReturnTypeManglingVal.kt"); + } + + @TestMetadata("withReturnTypeManglingFun.kt") + public void testWithReturnTypeManglingFun() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingFun.kt"); + } + + @TestMetadata("withReturnTypeManglingVal.kt") + public void testWithReturnTypeManglingVal() throws Exception { + runTest("compiler/testData/codegen/boxInline/inlineClasses/withReturnTypeManglingVal.kt"); + } } @TestMetadata("compiler/testData/codegen/boxInline/innerClasses")