diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java index 776c2ceb5f5..ae45ac0bbe8 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java @@ -2778,6 +2778,12 @@ public class FirLightTreeJvmIrTextTestGenerated extends AbstractFirLightTreeJvmI runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @Test + @TestMetadata("IntArrayAsVararg.kt") + public void testIntArrayAsVararg() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt"); + } + @Test @TestMetadata("integerLiteralWithExpectedTypealiasType.kt") public void testIntegerLiteralWithExpectedTypealiasType() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java index 009bc4cdb9f..fcbe75413a3 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java @@ -2778,6 +2778,12 @@ public class FirPsiJvmIrTextTestGenerated extends AbstractFirPsiJvmIrTextTest { runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @Test + @TestMetadata("IntArrayAsVararg.kt") + public void testIntArrayAsVararg() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt"); + } + @Test @TestMetadata("integerLiteralWithExpectedTypealiasType.kt") public void testIntegerLiteralWithExpectedTypealiasType() throws Exception { diff --git a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.fir.ir.txt b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.fir.ir.txt new file mode 100644 index 00000000000..3bafb15ae99 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.fir.ir.txt @@ -0,0 +1,16 @@ +FILE fqName: fileName:/IntArrayAsVararg.kt + FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun consumeVarargs (vararg arr: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + arr: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CALL 'public final fun consumeVarargs (vararg arr: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + arr: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + CALL 'public final fun intArrayOf (vararg elements: kotlin.Int): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null + elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + CONST Int type=kotlin.Int value=41 + CONST Int type=kotlin.Int value=42 + FUN name:consumeVarargs visibility:public modality:FINAL <> (arr:kotlin.IntArray) returnType:kotlin.Unit + VALUE_PARAMETER name:arr index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.fir.kt.txt b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.fir.kt.txt new file mode 100644 index 00000000000..dfdaeeefb80 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.fir.kt.txt @@ -0,0 +1,7 @@ +fun main() { + consumeVarargs(arr = [1, 2]) + consumeVarargs(arr = [intArrayOf(elements = [41, 42])]) +} + +fun consumeVarargs(vararg arr: Int) { +} diff --git a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.ir.txt b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.ir.txt new file mode 100644 index 00000000000..d1db34729b4 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.ir.txt @@ -0,0 +1,17 @@ +FILE fqName: fileName:/IntArrayAsVararg.kt + FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CALL 'public final fun consumeVarargs (vararg arr: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + arr: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CALL 'public final fun consumeVarargs (vararg arr: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null + arr: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + SPREAD_ELEMENT + CALL 'public final fun intArrayOf (vararg elements: kotlin.Int): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null + elements: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + CONST Int type=kotlin.Int value=41 + CONST Int type=kotlin.Int value=42 + FUN name:consumeVarargs visibility:public modality:FINAL <> (arr:kotlin.IntArray) returnType:kotlin.Unit + VALUE_PARAMETER name:arr index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] + BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt new file mode 100644 index 00000000000..b13e522ee2e --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt @@ -0,0 +1,10 @@ +// WITH_STDLIB +// ISSUE: KT-60312 +// SKIP_SIGNATURE_DUMP + +fun main() { + consumeVarargs(1, 2) + consumeVarargs(arr = intArrayOf(41, 42)) +} + +fun consumeVarargs(vararg arr: Int) {} diff --git a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt.txt b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt.txt new file mode 100644 index 00000000000..972cb7e4c9f --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt.txt @@ -0,0 +1,7 @@ +fun main() { + consumeVarargs(arr = [1, 2]) + consumeVarargs(arr = [*intArrayOf(elements = [41, 42])]) +} + +fun consumeVarargs(vararg arr: Int) { +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java index e167fec38dd..f8076021c30 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java @@ -2778,6 +2778,12 @@ public class ClassicJvmIrTextTestGenerated extends AbstractClassicJvmIrTextTest runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @Test + @TestMetadata("IntArrayAsVararg.kt") + public void testIntArrayAsVararg() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt"); + } + @Test @TestMetadata("integerLiteralWithExpectedTypealiasType.kt") public void testIntegerLiteralWithExpectedTypealiasType() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java index a4f3e629a29..6ff8e2deb6c 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java @@ -2088,6 +2088,11 @@ public class KlibIrTextTestCaseGenerated extends AbstractKlibIrTextTestCase { runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @TestMetadata("IntArrayAsVararg.kt") + public void testIntArrayAsVararg() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt"); + } + @TestMetadata("integerLiteralWithExpectedTypealiasType.kt") public void testIntegerLiteralWithExpectedTypealiasType() throws Exception { runTest("compiler/testData/ir/irText/firProblems/integerLiteralWithExpectedTypealiasType.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java index 845a228cd2b..ce9a98bda70 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java @@ -2394,6 +2394,12 @@ public class FirLightTreeJsIrTextTestGenerated extends AbstractFirLightTreeJsIrT runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @Test + @TestMetadata("IntArrayAsVararg.kt") + public void testIntArrayAsVararg() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt"); + } + @Test @TestMetadata("integerLiteralWithExpectedTypealiasType.kt") public void testIntegerLiteralWithExpectedTypealiasType() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java index 6ff79363e80..7598cda3032 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java @@ -2394,6 +2394,12 @@ public class FirPsiJsIrTextTestGenerated extends AbstractFirPsiJsIrTextTest { runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @Test + @TestMetadata("IntArrayAsVararg.kt") + public void testIntArrayAsVararg() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt"); + } + @Test @TestMetadata("integerLiteralWithExpectedTypealiasType.kt") public void testIntegerLiteralWithExpectedTypealiasType() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java index 5998db6eaf4..bddf89680fa 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java @@ -2394,6 +2394,12 @@ public class ClassicJsIrTextTestGenerated extends AbstractClassicJsIrTextTest { runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @Test + @TestMetadata("IntArrayAsVararg.kt") + public void testIntArrayAsVararg() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt"); + } + @Test @TestMetadata("integerLiteralWithExpectedTypealiasType.kt") public void testIntegerLiteralWithExpectedTypealiasType() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java index f5f2c4f31c4..14c16cee3a1 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java @@ -2400,6 +2400,12 @@ public class ClassicNativeIrTextTestGenerated extends AbstractClassicNativeIrTex runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @Test + @TestMetadata("IntArrayAsVararg.kt") + public void testIntArrayAsVararg() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt"); + } + @Test @TestMetadata("integerLiteralWithExpectedTypealiasType.kt") public void testIntegerLiteralWithExpectedTypealiasType() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java index fcf19682f55..019da2fc9e7 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java @@ -2400,6 +2400,12 @@ public class FirLightTreeNativeIrTextTestGenerated extends AbstractFirLightTreeN runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @Test + @TestMetadata("IntArrayAsVararg.kt") + public void testIntArrayAsVararg() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt"); + } + @Test @TestMetadata("integerLiteralWithExpectedTypealiasType.kt") public void testIntegerLiteralWithExpectedTypealiasType() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java index 0e98620ff4d..d757f44c61f 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java @@ -2400,6 +2400,12 @@ public class FirPsiNativeIrTextTestGenerated extends AbstractFirPsiNativeIrTextT runTest("compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.kt"); } + @Test + @TestMetadata("IntArrayAsVararg.kt") + public void testIntArrayAsVararg() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt"); + } + @Test @TestMetadata("integerLiteralWithExpectedTypealiasType.kt") public void testIntegerLiteralWithExpectedTypealiasType() throws Exception {