diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java index ac115b97a85..4d0986c9b60 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java @@ -4103,6 +4103,12 @@ public class FirBlackBoxInlineCodegenTestGenerated extends AbstractFirBlackBoxIn public void testFlexibleType() throws Exception { runTest("compiler/testData/codegen/boxInline/signatureMangling/flexibleType.kt"); } + + @Test + @TestMetadata("indices.kt") + public void testIndices() throws Exception { + runTest("compiler/testData/codegen/boxInline/signatureMangling/indices.kt"); + } } @Nested diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/ir/IrMangleComputer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/ir/IrMangleComputer.kt index cdc7c61c10e..7f93617b9d2 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/ir/IrMangleComputer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/mangle/ir/IrMangleComputer.kt @@ -232,7 +232,9 @@ abstract class IrMangleComputer(protected val builder: StringBuilder, private va declaration.parent.acceptVoid(this) val isStaticProperty = if (accessor != null) - accessor.let { it.dispatchReceiverParameter == null && declaration.parent !is IrPackageFragment } + accessor.let { + it.dispatchReceiverParameter == null && declaration.parent !is IrPackageFragment && !declaration.parent.isFacadeClass + } else { // Fake override for a Java field val backingField = declaration.resolveFakeOverride()?.backingField diff --git a/compiler/testData/codegen/boxInline/signatureMangling/indices.kt b/compiler/testData/codegen/boxInline/signatureMangling/indices.kt new file mode 100644 index 00000000000..4f3331b8efe --- /dev/null +++ b/compiler/testData/codegen/boxInline/signatureMangling/indices.kt @@ -0,0 +1,10 @@ +// TARGET_BACKEND: JVM_IR +// WITH_RUNTIME +// FILE: 1.kt +inline fun inlineCallingIndices(): String { + val i1 = arrayOf("one", "two").indices + return "OK" +} + +// FILE: 2.kt +fun box() = inlineCallingIndices() \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java index 8877d6f606f..620183f1f28 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java @@ -4103,6 +4103,12 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli public void testFlexibleType() throws Exception { runTest("compiler/testData/codegen/boxInline/signatureMangling/flexibleType.kt"); } + + @Test + @TestMetadata("indices.kt") + public void testIndices() throws Exception { + runTest("compiler/testData/codegen/boxInline/signatureMangling/indices.kt"); + } } @Nested diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index 240d3bc1092..34855452598 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -4103,6 +4103,12 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC public void testFlexibleType() throws Exception { runTest("compiler/testData/codegen/boxInline/signatureMangling/flexibleType.kt"); } + + @Test + @TestMetadata("indices.kt") + public void testIndices() throws Exception { + runTest("compiler/testData/codegen/boxInline/signatureMangling/indices.kt"); + } } @Nested diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java index 4a2a4238844..69f3c2223d0 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -4103,6 +4103,12 @@ public class IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated extends Ab public void testFlexibleType() throws Exception { runTest("compiler/testData/codegen/boxInline/signatureMangling/flexibleType.kt"); } + + @Test + @TestMetadata("indices.kt") + public void testIndices() throws Exception { + runTest("compiler/testData/codegen/boxInline/signatureMangling/indices.kt"); + } } @Nested diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java index ba7fff2af45..52509d057e8 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java @@ -4103,6 +4103,12 @@ public class JvmIrAgainstOldBoxInlineTestGenerated extends AbstractJvmIrAgainstO public void testFlexibleType() throws Exception { runTest("compiler/testData/codegen/boxInline/signatureMangling/flexibleType.kt"); } + + @Test + @TestMetadata("indices.kt") + public void testIndices() throws Exception { + runTest("compiler/testData/codegen/boxInline/signatureMangling/indices.kt"); + } } @Nested