diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index 0c98c146044..88340c54c78 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -45,6 +45,7 @@ import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.ir.symbols.* import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.dump +import org.jetbrains.kotlin.ir.util.isPrimitiveArray import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.calls.NewCommonSuperTypeCalculator.commonSuperType import org.jetbrains.kotlin.types.Variance @@ -1075,7 +1076,7 @@ class CallAndReferenceGenerator( if (irVarargElement !is IrSpreadElement && argument.arguments[i] is FirNamedArgumentExpression && irVarargElement is IrExpression && - irVarargElement.type.isArray() + (irVarargElement.type.isArray() || irVarargElement.type.isPrimitiveArray()) ) { elements[i] = IrSpreadElementImpl(irVarargElement.startOffset, irVarargElement.endOffset, irVarargElement) } diff --git a/compiler/testData/codegen/boxWasmJsInterop/vararg.kt b/compiler/testData/codegen/boxWasmJsInterop/vararg.kt index 2d84644348a..fab33473e27 100644 --- a/compiler/testData/codegen/boxWasmJsInterop/vararg.kt +++ b/compiler/testData/codegen/boxWasmJsInterop/vararg.kt @@ -1,6 +1,3 @@ -// IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 -// IGNORE_BACKEND_K2: WASM - // Partial copy of js/js.translator/testData/box/native/vararg.kt // With some additions for concrete number types, strings and function references diff --git a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.fir.ir.txt b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.fir.ir.txt deleted file mode 100644 index 3bafb15ae99..00000000000 --- a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.fir.ir.txt +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index dfdaeeefb80..00000000000 --- a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.fir.kt.txt +++ /dev/null @@ -1,7 +0,0 @@ -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.kt b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt index b13e522ee2e..2ffd7690312 100644 --- a/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt +++ b/compiler/testData/ir/irText/firProblems/IntArrayAsVararg.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB // ISSUE: KT-60312 // SKIP_SIGNATURE_DUMP diff --git a/js/js.translator/testData/box/native/vararg.kt b/js/js.translator/testData/box/native/vararg.kt index 5dce2ab4693..fb5114a724c 100644 --- a/js/js.translator/testData/box/native/vararg.kt +++ b/js/js.translator/testData/box/native/vararg.kt @@ -1,5 +1,4 @@ // IGNORE_BACKEND: WASM -// IGNORE_BACKEND_K2: JS_IR, JS_IR_ES6 // EXPECTED_REACHABLE_NODES: 1314 package foo