diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 6125d1c4f9c..99ec9e735bf 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -550,7 +550,7 @@ class Fir2IrVisitor( } private fun FirExpression.convertToIrVarargElement(): IrVarargElement = - if (this is FirSpreadArgumentExpression || this is FirNamedArgumentExpression && this.isSpread) { + if (this is FirSpreadArgumentExpression) { IrSpreadElementImpl( source?.startOffset ?: UNDEFINED_OFFSET, source?.endOffset ?: UNDEFINED_OFFSET, 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 311a2616fa3..1cadb4b310c 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 @@ -1072,27 +1072,9 @@ class CallAndReferenceGenerator( } } return irArgument - .applyAssigningArrayElementsToVarargInNamedForm(unwrappedArgument, parameter) .applyImplicitIntegerCoercionIfNeeded(unwrappedArgument, parameter) } - private fun IrExpression.applyAssigningArrayElementsToVarargInNamedForm( - argument: FirExpression, - parameter: FirValueParameter?, - ): IrExpression { - if (this is IrVararg && parameter?.isVararg == true && argument is FirVarargArgumentsExpression && elements.size == 1) { - val irVarargElement = elements[0] - if (argument.arguments[0] is FirNamedArgumentExpression && - // IrVarargElement can be either IrSpreadElement (then nothing to do) or IrExpression - irVarargElement is IrExpression && - (irVarargElement.type.isArray() || irVarargElement.type.isPrimitiveArray() || irVarargElement.type.isUnsignedArray()) - ) { - elements[0] = IrSpreadElementImpl(irVarargElement.startOffset, irVarargElement.endOffset, irVarargElement) - } - } - return this - } - private fun IrExpression.applyImplicitIntegerCoercionIfNeeded( argument: FirExpression, parameter: FirValueParameter?,