IR: fix mangling of toplevel properties

This commit is contained in:
Georgy Bronnikov
2021-07-20 18:52:06 +03:00
committed by TeamCityServer
parent 54957ead5c
commit fb801bdc33
7 changed files with 43 additions and 1 deletions
@@ -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
@@ -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
@@ -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()
@@ -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
@@ -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
@@ -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
@@ -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