FIR2IR: don't generate IR getter for const library properties

This commit is contained in:
Mikhail Glukhikh
2021-01-25 10:55:14 +03:00
parent e2521718dd
commit b311e95487
6 changed files with 42 additions and 0 deletions
@@ -13706,6 +13706,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/fir/ExtensionAlias.kt");
}
@Test
@TestMetadata("IrBuiltIns.kt")
public void testIrBuiltIns() throws Exception {
runTest("compiler/testData/codegen/box/fir/IrBuiltIns.kt");
}
@Test
@TestMetadata("SuspendExtension.kt")
public void testSuspendExtension() throws Exception {
@@ -127,6 +127,7 @@ class Fir2IrLazyProperty(
}
override var getter: IrSimpleFunction? by lazyVar {
if (fir.isConst) return@lazyVar null
Fir2IrLazyPropertyAccessor(
components, startOffset, endOffset,
when {
+18
View File
@@ -0,0 +1,18 @@
// TARGET_BACKEND: JVM
// MODULE: lib
// FILE: A.kt
class IrBuiltIns {
object OperatorNames {
const val LESS = "OK"
}
}
// MODULE: main(lib)
// FILE: B.kt
fun foo(s: String) = s
fun box(): String {
return foo(IrBuiltIns.OperatorNames.LESS)
}
@@ -13706,6 +13706,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/fir/ExtensionAlias.kt");
}
@Test
@TestMetadata("IrBuiltIns.kt")
public void testIrBuiltIns() throws Exception {
runTest("compiler/testData/codegen/box/fir/IrBuiltIns.kt");
}
@Test
@TestMetadata("SuspendExtension.kt")
public void testSuspendExtension() throws Exception {
@@ -13706,6 +13706,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/fir/ExtensionAlias.kt");
}
@Test
@TestMetadata("IrBuiltIns.kt")
public void testIrBuiltIns() throws Exception {
runTest("compiler/testData/codegen/box/fir/IrBuiltIns.kt");
}
@Test
@TestMetadata("SuspendExtension.kt")
public void testSuspendExtension() throws Exception {
@@ -12046,6 +12046,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
public void testExtensionAlias() throws Exception {
runTest("compiler/testData/codegen/box/fir/ExtensionAlias.kt");
}
@TestMetadata("IrBuiltIns.kt")
public void testIrBuiltIns() throws Exception {
runTest("compiler/testData/codegen/box/fir/IrBuiltIns.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/fullJdk")