diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 162e67b96b6..c20ac61be08 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -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 { diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt index e63dc047653..8dc975fe056 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt @@ -127,6 +127,7 @@ class Fir2IrLazyProperty( } override var getter: IrSimpleFunction? by lazyVar { + if (fir.isConst) return@lazyVar null Fir2IrLazyPropertyAccessor( components, startOffset, endOffset, when { diff --git a/compiler/testData/codegen/box/fir/IrBuiltIns.kt b/compiler/testData/codegen/box/fir/IrBuiltIns.kt new file mode 100644 index 00000000000..4935b3312e7 --- /dev/null +++ b/compiler/testData/codegen/box/fir/IrBuiltIns.kt @@ -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) +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index bffd9fc2e07..2433ee275cf 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -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 { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 5ccba3a78a5..3a4bc06fb9e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -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 { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 00323b09d18..5b934ee7745 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -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")