diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index cb6e96f07df..1abe25c80aa 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -18541,6 +18541,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/fir/SuspendFunctionReference.kt"); } + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } + @Test @TestMetadata("unqualifiedEnum.kt") public void testUnqualifiedEnum() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index d37c9e6332b..2433363e74a 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -18541,6 +18541,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/fir/SuspendFunctionReference.kt"); } + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } + @Test @TestMetadata("unqualifiedEnum.kt") public void testUnqualifiedEnum() throws Exception { diff --git a/compiler/testData/codegen/box/fir/toLong.kt b/compiler/testData/codegen/box/fir/toLong.kt new file mode 100644 index 00000000000..82d8ca69798 --- /dev/null +++ b/compiler/testData/codegen/box/fir/toLong.kt @@ -0,0 +1,20 @@ +// ISSUE: KT-57986 +// IGNORE_BACKEND_K2: JS_IR, NATIVE + +// MODULE: m1 +// FILE: m1.kt + +fun foo() = 42 + +val x = foo() +val y = x.toLong() + +// MODULE: m2(m1) +// FILE: m2.kt + +fun box(): String { + if (y == 42L) { + return "OK" + } + return y.toString() +} 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 e819c2227a5..0713e21789d 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 @@ -17664,6 +17664,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testSuspendFunctionReference() throws Exception { runTest("compiler/testData/codegen/box/fir/SuspendFunctionReference.kt"); } + + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @Nested 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 cf8a5d9cb0c..1d2a12abe08 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 @@ -18541,6 +18541,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/fir/SuspendFunctionReference.kt"); } + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } + @Test @TestMetadata("unqualifiedEnum.kt") public void testUnqualifiedEnum() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index 41f0b9953ce..a96d2ac0338 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -18541,6 +18541,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/fir/SuspendFunctionReference.kt"); } + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } + @Test @TestMetadata("unqualifiedEnum.kt") public void testUnqualifiedEnum() 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 dc20bb1543c..7f3bcc8ae71 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -14632,6 +14632,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testSuspendFunctionReference() throws Exception { runTest("compiler/testData/codegen/box/fir/SuspendFunctionReference.kt"); } + + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @TestMetadata("compiler/testData/codegen/box/fullJdk") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index 826ee039280..ba5c9c997e1 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -13604,6 +13604,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { public void testNestedClassTypeParameterDeserialization() throws Exception { runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt"); } + + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @Nested diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java index 2a5834a7916..88eedd5e537 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java @@ -13700,6 +13700,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { public void testNestedClassTypeParameterDeserialization() throws Exception { runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt"); } + + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @Nested diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index ff1f6ef89ca..2f14e177fc0 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -13700,6 +13700,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { public void testNestedClassTypeParameterDeserialization() throws Exception { runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt"); } + + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @Nested diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java index 81ba076c55c..c5784564f4d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java @@ -13700,6 +13700,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes public void testNestedClassTypeParameterDeserialization() throws Exception { runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt"); } + + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @Nested diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java index 16aa71eb689..293c8fd2278 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java @@ -15093,6 +15093,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe public void testNestedClassTypeParameterDeserialization() throws Exception { runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt"); } + + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @Nested diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java index 11a105e8c9a..a1bd054c998 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java @@ -15445,6 +15445,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB public void testNestedClassTypeParameterDeserialization() throws Exception { runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt"); } + + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @Nested diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index bfd460a4b78..1a584fde4b7 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -14917,6 +14917,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest public void testNestedClassTypeParameterDeserialization() throws Exception { runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt"); } + + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @Nested diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java index b6e35766efb..84864e47de6 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java @@ -15269,6 +15269,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT public void testNestedClassTypeParameterDeserialization() throws Exception { runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt"); } + + @Test + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @Nested diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java index 08aa1d1fed6..23355b939ec 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java @@ -12157,6 +12157,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest public void testNestedClassTypeParameterDeserialization() throws Exception { runTest("compiler/testData/codegen/box/fir/nestedClassTypeParameterDeserialization.kt"); } + + @TestMetadata("toLong.kt") + public void testToLong() throws Exception { + runTest("compiler/testData/codegen/box/fir/toLong.kt"); + } } @TestMetadata("compiler/testData/codegen/box/fullJdk")