JVM IR: workaround indirect dependency between lowerings
#KT-51353 Fixed
This commit is contained in:
+6
@@ -21163,6 +21163,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt51254.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51353.kt")
|
||||
public void testKt51353() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt51353.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
|
||||
+5
-1
@@ -290,7 +290,11 @@ class MemoizedInlineClassReplacements(
|
||||
parent = propertySymbol.owner.parent
|
||||
copyAttributes(propertySymbol.owner)
|
||||
annotations = propertySymbol.owner.annotations
|
||||
backingField = propertySymbol.owner.backingField
|
||||
// In case this property is declared in an object in another file which is not yet lowered, its backing field will
|
||||
// be made static later. We have to handle it here though, because this new property will be saved to the cache
|
||||
// and reused when lowering the same call in all subsequent files, which would be incorrect if it was unlowered.
|
||||
backingField = context.cachedDeclarations.getStaticBackingField(propertySymbol.owner)
|
||||
?: propertySymbol.owner.backingField
|
||||
}
|
||||
}
|
||||
correspondingPropertySymbol = property.symbol
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_STDLIB
|
||||
// FILE: 1.kt
|
||||
|
||||
val referenceFromOtherFile = O.A
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
@JvmInline
|
||||
value class Z(val value: String)
|
||||
|
||||
object O {
|
||||
val A = Z("OK")
|
||||
val B = A
|
||||
}
|
||||
|
||||
fun box(): String = O.B.value
|
||||
+6
@@ -20725,6 +20725,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt51254.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51353.kt")
|
||||
public void testKt51353() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt51353.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
|
||||
+6
@@ -21163,6 +21163,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt51254.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt51353.kt")
|
||||
public void testKt51353() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt51353.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
|
||||
+5
@@ -17315,6 +17315,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt51157.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt51353.kt")
|
||||
public void testKt51353() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/kt51353.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("mangledDefaultParameterFunction.kt")
|
||||
public void testMangledDefaultParameterFunction() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/inlineClasses/mangledDefaultParameterFunction.kt", TransformersFunctions.getReplaceOptionalJvmInlineAnnotationWithReal());
|
||||
|
||||
Reference in New Issue
Block a user