diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index 354136c5124..d3ac3a60d00 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -59,7 +59,7 @@ fun ConeKotlinType.toIrType( return when (this) { is ConeKotlinErrorType -> createErrorType() is ConeLookupTagBasedType -> { - val irSymbol = getPrimitiveArrayType(this.classId, irBuiltIns) ?: run { + val irSymbol = getArrayType(this.classId, irBuiltIns) ?: run { val firSymbol = this.lookupTag.toSymbol(session) ?: return createErrorType() firSymbol.toIrSymbol(session, declarationStorage) } @@ -87,8 +87,9 @@ fun ConeKotlinType.toIrType( } } -private fun getPrimitiveArrayType(classId: ClassId?, irBuiltIns: IrBuiltIns): IrClassifierSymbol? { +private fun getArrayType(classId: ClassId?, irBuiltIns: IrBuiltIns): IrClassifierSymbol? { val irType = when (classId) { + ClassId(FqName("kotlin"), FqName("Array"), false) -> return irBuiltIns.arrayClass ClassId(FqName("kotlin"), FqName("BooleanArray"), false) -> irBuiltIns.booleanType ClassId(FqName("kotlin"), FqName("ByteArray"), false) -> irBuiltIns.byteType ClassId(FqName("kotlin"), FqName("CharArray"), false) -> irBuiltIns.charType diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index be38e5c294b..91e936148bb 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -23,7 +23,10 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol +import org.jetbrains.kotlin.fir.types.ConeKotlinType import org.jetbrains.kotlin.fir.types.FirTypeRef +import org.jetbrains.kotlin.fir.types.arrayElementType +import org.jetbrains.kotlin.fir.types.coneTypeSafe import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.declarations.impl.* @@ -686,7 +689,9 @@ class Fir2IrDeclarationStorage( IrValueParameterImpl( startOffset, endOffset, origin, symbol, valueParameter.name, index, type, - null, valueParameter.isCrossinline, valueParameter.isNoinline + if (!valueParameter.isVararg) null + else valueParameter.returnTypeRef.coneTypeSafe()?.arrayElementType(session)?.toIrType(session, this, irBuiltIns), + valueParameter.isCrossinline, valueParameter.isNoinline ).apply { descriptor.bind(this) if (valueParameter.defaultValue != null) { 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 bd3557bf582..81ed461eaac 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 @@ -33,6 +33,7 @@ import org.jetbrains.kotlin.fir.visitors.FirDefaultVisitor import org.jetbrains.kotlin.fir.visitors.transformSingle import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.builders.* import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.declarations.impl.IrFieldImpl @@ -674,6 +675,18 @@ class Fir2IrVisitor( return wrappedArgumentExpression.expression.toIrExpression() } + override fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression, data: Any?): IrElement { + val irReturnType = varargArgumentsExpression.typeRef.toIrType(session, declarationStorage) + return IrVarargImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, irReturnType, + varargArgumentsExpression.varargElementType.toIrType(session, declarationStorage), + varargArgumentsExpression.arguments.map { arg -> + arg.toIrExpression().run { + if (arg is FirSpreadArgumentExpression) IrSpreadElementImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, this) + else this + } + }) + } + private fun FirReference.statementOrigin(): IrStatementOrigin? { return when (this) { is FirPropertyFromParameterResolvedNamedReference -> IrStatementOrigin.INITIALIZE_PROPERTY_FROM_PARAMETER diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompletionResultsWriterTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompletionResultsWriterTransformer.kt index be29a3c6e3f..310d36d45ae 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompletionResultsWriterTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirCallCompletionResultsWriterTransformer.kt @@ -9,6 +9,8 @@ import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.diagnostics.FirSimpleDiagnostic import org.jetbrains.kotlin.fir.expressions.* +import org.jetbrains.kotlin.fir.expressions.impl.FirFunctionCallImpl +import org.jetbrains.kotlin.fir.expressions.impl.FirVarargArgumentsExpressionImpl import org.jetbrains.kotlin.fir.references.impl.FirResolvedCallableReferenceImpl import org.jetbrains.kotlin.fir.references.impl.FirResolvedNamedReferenceImpl import org.jetbrains.kotlin.fir.resolve.calls.Candidate @@ -32,6 +34,7 @@ import org.jetbrains.kotlin.fir.visitors.transformSingle import org.jetbrains.kotlin.types.AbstractTypeApproximator import org.jetbrains.kotlin.types.TypeApproximatorConfiguration import org.jetbrains.kotlin.types.Variance +import java.lang.Math.min class FirCallCompletionResultsWriterTransformer( override val session: FirSession, @@ -189,7 +192,36 @@ class FirCallCompletionResultsWriterTransformer( } else -> { resultType = typeRef.substituteTypeRef(subCandidate) - result.transformArguments(this, subCandidate.createArgumentsMapping()).transformExplicitReceiver(integerApproximator, null) + val vararg = subCandidate.argumentMapping?.values?.firstOrNull { it.isVararg } + result.transformArguments(this, subCandidate.createArgumentsMapping()).apply { + if (vararg != null && this is FirFunctionCallImpl) { + // Create a FirVarargArgumentExpression for the vararg arguments + val resolvedArrayType = vararg.returnTypeRef.substitute(subCandidate) + val resolvedElementType = resolvedArrayType.arrayElementType(session) + val varargArgument = FirVarargArgumentsExpressionImpl( + null, + vararg.returnTypeRef.withReplacedConeType(resolvedElementType) + ) + varargArgument.replaceTypeRef( + vararg.returnTypeRef.withReplacedConeType( + vararg.returnTypeRef.substitute( + subCandidate + ) + ) + ) + var firstIndex = arguments.size + for ((i, arg) in arguments.withIndex()) { + if (subCandidate.argumentMapping!![arg]?.isVararg ?: false) { + firstIndex = min(firstIndex, i) + varargArgument.arguments.add(arg) + } + } + for (arg in varargArgument.arguments) { + arguments.remove(arg) + } + arguments.add(firstIndex, varargArgument) + } + }.transformExplicitReceiver(integerApproximator, null) } } @@ -199,14 +231,16 @@ class FirCallCompletionResultsWriterTransformer( ).compose() } + private fun FirTypeRef.substitute(candidate: Candidate): ConeKotlinType = + coneTypeUnsafe() + .let { candidate.substitutor.substituteOrSelf(it) } + .let { finalSubstitutor.substituteOrSelf(it) } + private fun Candidate.createArgumentsMapping(): ExpectedArgumentType? { return argumentMapping?.map { (argument, valueParameter) -> - val expectedType = valueParameter.returnTypeRef.coneTypeUnsafe() - .let { substitutor.substituteOrSelf(it) } - .let { finalSubstitutor.substituteOrSelf(it) } - - argument.expandArgument() to expectedType - } + val expectedType = valueParameter.returnTypeRef.substitute(this) + argument.unwrapArgument() to expectedType + } ?.toMap()?.toExpectedType() } @@ -330,7 +364,7 @@ private fun ExpectedArgumentType.getExpectedType(argument: FirExpression): ConeK private fun Map.toExpectedType(): ExpectedArgumentType = ExpectedArgumentType.ArgumentsMap(this) fun ConeKotlinType.toExpectedType(): ExpectedArgumentType = ExpectedArgumentType.ExpectedType(this) -private fun FirExpression.expandArgument(): FirExpression = when (this) { +private fun FirExpression.unwrapArgument(): FirExpression = when (this) { is FirWrappedArgumentExpression -> expression else -> this } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSyntheticCallGenerator.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSyntheticCallGenerator.kt index 3b866b18a41..29f2e2e444b 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSyntheticCallGenerator.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSyntheticCallGenerator.kt @@ -122,7 +122,8 @@ class FirSyntheticCallGenerator( ) val fakeCallElement = FirFunctionCallImpl(null).copy(calleeReference = reference, arguments = arguments) - return callCompleter.completeCall(fakeCallElement, expectedTypeRef).arguments[0] as FirCallableReferenceAccess? + val argument = callCompleter.completeCall(fakeCallElement, expectedTypeRef).arguments[0] + return ((argument as? FirVarargArgumentsExpression)?.arguments?.get(0) ?: argument) as FirCallableReferenceAccess? } private fun generateCalleeReferenceWithCandidate( diff --git a/compiler/fir/resolve/testData/resolve/arguments/default.txt b/compiler/fir/resolve/testData/resolve/arguments/default.txt index b75749b330a..bdd63e6f7fa 100644 --- a/compiler/fir/resolve/testData/resolve/arguments/default.txt +++ b/compiler/fir/resolve/testData/resolve/arguments/default.txt @@ -17,7 +17,7 @@ FILE: default.kt R|/bar|(Int(1), Double(2.0), Boolean(true), String(my)) #(Int(1), Boolean(true)) R|/baz|(Int(1)) - R|/baz|(Int(1), String(my), String(yours)) + R|/baz|(Int(1), vararg(String(my), String(yours))) R|/baz|(Int(1), z = Boolean(true)) #(Int(0), String(), Boolean(false)) } diff --git a/compiler/fir/resolve/testData/resolve/arguments/vararg.txt b/compiler/fir/resolve/testData/resolve/arguments/vararg.txt index 25fee9b4118..565e04c072e 100644 --- a/compiler/fir/resolve/testData/resolve/arguments/vararg.txt +++ b/compiler/fir/resolve/testData/resolve/arguments/vararg.txt @@ -5,12 +5,12 @@ FILE: vararg.kt } public final fun test(): R|kotlin/Unit| { R|/foo|(Int(1)) - R|/foo|(Int(1), String()) - R|/foo|(Int(1), String(my), String(yours)) - R|/foo|(Int(1), *R|kotlin/arrayOf|(String(my), String(yours))) + R|/foo|(Int(1), vararg(String())) + R|/foo|(Int(1), vararg(String(my), String(yours))) + R|/foo|(Int(1), vararg(*R|kotlin/arrayOf|(vararg(String(my), String(yours))))) #(String()) #(Int(1), Int(2)) - R|/bar|(Int(1), z = Boolean(true), y = *R|kotlin/arrayOf|(String(my), String(yours))) + R|/bar|(Int(1), z = Boolean(true), vararg(y = *R|kotlin/arrayOf|(vararg(String(my), String(yours))))) #(Int(0), z = Boolean(false), y = String(), y = String(other)) #(Int(0), String(), Boolean(true)) } diff --git a/compiler/fir/resolve/testData/resolve/cfg/postponedLambdas.txt b/compiler/fir/resolve/testData/resolve/cfg/postponedLambdas.txt index f54736b7076..74cadd80d45 100644 --- a/compiler/fir/resolve/testData/resolve/cfg/postponedLambdas.txt +++ b/compiler/fir/resolve/testData/resolve/cfg/postponedLambdas.txt @@ -2,8 +2,8 @@ FILE: postponedLambdas.kt public final inline fun foo(vararg x: R|kotlin/Array|): R|kotlin/Unit| { } public final fun test(a: R|kotlin/Any|, b: R|kotlin/Any|, c: R|kotlin/Any|): R|kotlin/Unit| { - R|/foo|(R|/a|, foo@fun (): R|kotlin/String| { + R|/foo|(vararg(R|/a|, R|/b|), foo@fun (): R|kotlin/String| { String() } - , R|/b|) + ) } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/enumEntryUse.txt b/compiler/fir/resolve/testData/resolve/expresssions/enumEntryUse.txt index fa24a1af6e1..c252b96cbbf 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/enumEntryUse.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/enumEntryUse.txt @@ -45,6 +45,6 @@ FILE: enumEntryUse.kt R|/use|(Q|TestEnum|.R|/TestEnum.FIRST|) R|/useEnum|(Q|TestEnum|.R|/TestEnum.SECOND|) R|/useEnum|(Q|TestEnum|.R|/TestEnum.THIRD|) - R|/useVararg|(Q|TestEnum|.R|/TestEnum.FIRST|, Q|TestEnum|.R|/TestEnum.SECOND|) + R|/useVararg|(vararg(Q|TestEnum|.R|/TestEnum.FIRST|, Q|TestEnum|.R|/TestEnum.SECOND|)) #(Int(1), Int(2), Int(3), Int(4), Int(5)) } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/vararg.txt b/compiler/fir/resolve/testData/resolve/expresssions/vararg.txt index d6b99fd8ac4..037d1a3392c 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/vararg.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/vararg.txt @@ -5,5 +5,5 @@ FILE: vararg.kt } public final fun main(): R|kotlin/Unit| { R|/foo|() - R|/foo|(String(!)) + R|/foo|(vararg(String(!))) } diff --git a/compiler/fir/resolve/testData/resolve/problems2.txt b/compiler/fir/resolve/testData/resolve/problems2.txt index 898fae88642..869fdc94fcb 100644 --- a/compiler/fir/resolve/testData/resolve/problems2.txt +++ b/compiler/fir/resolve/testData/resolve/problems2.txt @@ -61,7 +61,7 @@ FILE: problems2.kt } public final fun test(): R|kotlin/Unit| { - Q|Some|.R|/Some.WithPrimary.WithPrimary|(Int(42), R|kotlin/arrayOf|(String(alpha), String(omega))) + Q|Some|.R|/Some.WithPrimary.WithPrimary|(Int(42), R|kotlin/arrayOf|(vararg(String(alpha), String(omega)))) } public final class KonanTarget : R|kotlin/Any| { public constructor(name: R|kotlin/String|): R|KonanTarget| { diff --git a/compiler/fir/resolve/testData/resolve/stdlib/addAllOnJavaCollection.txt b/compiler/fir/resolve/testData/resolve/stdlib/addAllOnJavaCollection.txt index 5d7b3d9ea0f..2f6e5914d52 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/addAllOnJavaCollection.txt +++ b/compiler/fir/resolve/testData/resolve/stdlib/addAllOnJavaCollection.txt @@ -1,6 +1,6 @@ FILE: addAllOnJavaCollection.kt public final fun foo(): R|kotlin/Unit| { - lval y: R|kotlin/collections/List| = R|kotlin/collections/listOf|(String(Alpha), String(Beta)) + lval y: R|kotlin/collections/List| = R|kotlin/collections/listOf|(vararg(String(Alpha), String(Beta))) lval x: R|java/util/LinkedHashSet| = R|java/util/LinkedHashSet.LinkedHashSet|().R|kotlin/apply||>( = apply@fun R|java/util/LinkedHashSet|.(): R|kotlin/Unit| { this@R|special/anonymous|.R|FakeOverride|(R|/y|) } diff --git a/compiler/fir/resolve/testData/resolve/stdlib/arrayInLocal.txt b/compiler/fir/resolve/testData/resolve/stdlib/arrayInLocal.txt index f9e1afe7794..6f4272458de 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/arrayInLocal.txt +++ b/compiler/fir/resolve/testData/resolve/stdlib/arrayInLocal.txt @@ -4,5 +4,5 @@ FILE: arrayInLocal.kt ^convert R|/paths|.R|kotlin/collections/toList|().R|kotlin/collections/toTypedArray|() } - R|/convert|(String(1), String(2), String(3)) + R|/convert|(vararg(String(1), String(2), String(3))) } diff --git a/compiler/fir/resolve/testData/resolve/stdlib/backingField.txt b/compiler/fir/resolve/testData/resolve/stdlib/backingField.txt index f946915c4b9..3795f1ba15a 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/backingField.txt +++ b/compiler/fir/resolve/testData/resolve/stdlib/backingField.txt @@ -1,5 +1,5 @@ FILE: backingField.kt - public final var myProperty: R|kotlin/collections/List| = R|kotlin/collections/listOf|(Int(1), Int(2), Int(3)) + public final var myProperty: R|kotlin/collections/List| = R|kotlin/collections/listOf|(vararg(Int(1), Int(2), Int(3))) public get(): R|kotlin/collections/List| { ^ F|/myProperty|.R|kotlin/collections/plus|(F|/myProperty|) } diff --git a/compiler/fir/resolve/testData/resolve/stdlib/topLevelResolve.txt b/compiler/fir/resolve/testData/resolve/stdlib/topLevelResolve.txt index 37a4253e928..c6434c2895c 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/topLevelResolve.txt +++ b/compiler/fir/resolve/testData/resolve/stdlib/topLevelResolve.txt @@ -7,31 +7,31 @@ FILE: topLevelResolve.kt lval c: R|kotlin/Char| = Char(a).R|kotlin/Char.plus|(Int(1)) lval s: R|kotlin/String| = String(.).R|kotlin/String.plus|(String(..)) lval ss: R|kotlin/String| = String().R|kotlin/String.plus|(Int(1)) - lval list: R|kotlin/collections/List| = R|kotlin/collections/listOf|(Int(1), Int(2), Int(3)).R|kotlin/collections/plus|(Int(4)) - lval listAndList: R|kotlin/collections/List| = R|kotlin/collections/listOf|(Int(4), Int(5), Int(6)).R|kotlin/collections/plus|(R|kotlin/collections/listOf|(Int(7), Int(8))) - lval mutableList: R|kotlin/collections/List| = R|kotlin/collections/mutableListOf|(Int(9), Int(10)).R|kotlin/collections/plus|(R|kotlin/collections/listOf|(Int(11), Int(12), Int(13))) - lval setAndList: R|kotlin/collections/Set| = R|kotlin/collections/setOf|(Int(0)).R|kotlin/collections/plus|(R|kotlin/collections/listOf|(Int(1), Int(2))) + lval list: R|kotlin/collections/List| = R|kotlin/collections/listOf|(vararg(Int(1), Int(2), Int(3))).R|kotlin/collections/plus|(Int(4)) + lval listAndList: R|kotlin/collections/List| = R|kotlin/collections/listOf|(vararg(Int(4), Int(5), Int(6))).R|kotlin/collections/plus|(R|kotlin/collections/listOf|(vararg(Int(7), Int(8)))) + lval mutableList: R|kotlin/collections/List| = R|kotlin/collections/mutableListOf|(vararg(Int(9), Int(10))).R|kotlin/collections/plus|(R|kotlin/collections/listOf|(vararg(Int(11), Int(12), Int(13)))) + lval setAndList: R|kotlin/collections/Set| = R|kotlin/collections/setOf|(Int(0)).R|kotlin/collections/plus|(R|kotlin/collections/listOf|(vararg(Int(1), Int(2)))) lval stringAndList: R|kotlin/String| = String().R|kotlin/String.plus|(R|kotlin/collections/emptyList|()) - lval map: R|kotlin/collections/Map| = R|kotlin/collections/mapOf|(String().R|kotlin/to|(Int(1)), String(.).R|kotlin/to|(Int(2))).R|kotlin/collections/plus|(String(..).R|kotlin/to|(Int(3))) + lval map: R|kotlin/collections/Map| = R|kotlin/collections/mapOf|(String().R|kotlin/to|(Int(1)), String(.).R|kotlin/to|(Int(2)), vararg()).R|kotlin/collections/plus|(String(..).R|kotlin/to|(Int(3))) lval mapAndMap: R|kotlin/collections/Map| = R|kotlin/collections/mapOf|(String(-).R|kotlin/to|(Int(4))).R|kotlin/collections/plus|(R|kotlin/collections/mapOf|(String(_).R|kotlin/to|(Int(5)))) } public final fun id(arg: R|T|): R|T| { ^id R|/arg| } public final fun testMap(): R|kotlin/Unit| { - lval first: R|kotlin/collections/List| = R|kotlin/collections/listOf|(Int(1), Int(2), Int(3)).R|kotlin/collections/map|( = map@fun (it: R|kotlin/Int|): R|kotlin/Int| { + lval first: R|kotlin/collections/List| = R|kotlin/collections/listOf|(vararg(Int(1), Int(2), Int(3))).R|kotlin/collections/map|( = map@fun (it: R|kotlin/Int|): R|kotlin/Int| { R|/it|.R|kotlin/Int.times|(Int(2)) } ) - lval second: R|kotlin/collections/List| = R|kotlin/intArrayOf|(Int(4), Int(5), Int(6)).R|kotlin/collections/map|( = map@fun (it: R|kotlin/Int|): R|kotlin/Int| { + lval second: R|kotlin/collections/List| = R|kotlin/intArrayOf|(vararg(Int(4), Int(5), Int(6))).R|kotlin/collections/map|( = map@fun (it: R|kotlin/Int|): R|kotlin/Int| { R|/it|.R|kotlin/Int.times|(Int(2)) } ) - lval withId: R|kotlin/collections/List| = R|kotlin/collections/listOf|(Int(1), Int(2), Int(3)).R|kotlin/collections/map|( = map@fun (it: R|kotlin/Int|): R|kotlin/Int| { + lval withId: R|kotlin/collections/List| = R|kotlin/collections/listOf|(vararg(Int(1), Int(2), Int(3))).R|kotlin/collections/map|( = map@fun (it: R|kotlin/Int|): R|kotlin/Int| { R|/id|(R|/it|) } ) - lval stringToInt: R|kotlin/collections/List| = R|kotlin/collections/listOf|(String(alpha), String(omega)).R|kotlin/collections/map|( = map@fun (it: R|kotlin/String|): R|kotlin/Int| { + lval stringToInt: R|kotlin/collections/List| = R|kotlin/collections/listOf|(vararg(String(alpha), String(omega))).R|kotlin/collections/map|( = map@fun (it: R|kotlin/String|): R|kotlin/Int| { R|/it|.R|kotlin/String.length| } ) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/expressions/FirVarargArgumentsExpression.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/expressions/FirVarargArgumentsExpression.kt new file mode 100644 index 00000000000..a10d992154a --- /dev/null +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/expressions/FirVarargArgumentsExpression.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.expressions + +import org.jetbrains.kotlin.fir.FirPureAbstractElement +import org.jetbrains.kotlin.fir.FirSourceElement +import org.jetbrains.kotlin.fir.types.FirTypeRef +import org.jetbrains.kotlin.fir.visitors.* + +/* + * This file was generated automatically + * DO NOT MODIFY IT MANUALLY + */ + +abstract class FirVarargArgumentsExpression : FirPureAbstractElement(), FirExpression { + abstract override val source: FirSourceElement? + abstract override val typeRef: FirTypeRef + abstract override val annotations: List + abstract val arguments: List + abstract val varargElementType: FirTypeRef + + override fun accept(visitor: FirVisitor, data: D): R = visitor.visitVarargArgumentsExpression(this, data) +} diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/expressions/impl/FirVarargArgumentsExpressionImpl.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/expressions/impl/FirVarargArgumentsExpressionImpl.kt new file mode 100644 index 00000000000..d15c3f2dbc5 --- /dev/null +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/expressions/impl/FirVarargArgumentsExpressionImpl.kt @@ -0,0 +1,48 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.expressions.impl + +import org.jetbrains.kotlin.fir.FirSourceElement +import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall +import org.jetbrains.kotlin.fir.expressions.FirExpression +import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression +import org.jetbrains.kotlin.fir.impl.FirAbstractAnnotatedElement +import org.jetbrains.kotlin.fir.types.FirTypeRef +import org.jetbrains.kotlin.fir.types.impl.FirImplicitTypeRefImpl +import org.jetbrains.kotlin.fir.visitors.* + +/* + * This file was generated automatically + * DO NOT MODIFY IT MANUALLY + */ + +class FirVarargArgumentsExpressionImpl( + override val source: FirSourceElement?, + override var varargElementType: FirTypeRef +) : FirVarargArgumentsExpression(), FirAbstractAnnotatedElement { + override var typeRef: FirTypeRef = FirImplicitTypeRefImpl(null) + override val annotations: MutableList = mutableListOf() + override val arguments: MutableList = mutableListOf() + + override fun acceptChildren(visitor: FirVisitor, data: D) { + typeRef.accept(visitor, data) + annotations.forEach { it.accept(visitor, data) } + arguments.forEach { it.accept(visitor, data) } + varargElementType.accept(visitor, data) + } + + override fun transformChildren(transformer: FirTransformer, data: D): FirVarargArgumentsExpressionImpl { + typeRef = typeRef.transformSingle(transformer, data) + annotations.transformInplace(transformer, data) + arguments.transformInplace(transformer, data) + varargElementType = varargElementType.transformSingle(transformer, data) + return this + } + + override fun replaceTypeRef(newTypeRef: FirTypeRef) { + typeRef = newTypeRef + } +} diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirTransformer.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirTransformer.kt index 54f036902bd..e8ffcf313d7 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirTransformer.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirTransformer.kt @@ -92,6 +92,7 @@ import org.jetbrains.kotlin.fir.expressions.FirWrappedArgumentExpression import org.jetbrains.kotlin.fir.expressions.FirLambdaArgumentExpression import org.jetbrains.kotlin.fir.expressions.FirSpreadArgumentExpression import org.jetbrains.kotlin.fir.expressions.FirNamedArgumentExpression +import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier import org.jetbrains.kotlin.fir.expressions.FirResolvedReifiedParameterReference import org.jetbrains.kotlin.fir.expressions.FirReturnExpression @@ -474,6 +475,10 @@ abstract class FirTransformer : FirVisitor { + return transformElement(varargArgumentsExpression, data) + } + open fun transformResolvedQualifier(resolvedQualifier: FirResolvedQualifier, data: D): CompositeTransformResult { return transformElement(resolvedQualifier, data) } @@ -930,6 +935,10 @@ abstract class FirTransformer : FirVisitor { + return transformVarargArgumentsExpression(varargArgumentsExpression, data) + } + final override fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier, data: D): CompositeTransformResult { return transformResolvedQualifier(resolvedQualifier, data) } diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirVisitor.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirVisitor.kt index 93b1122f706..d9727f8ce1d 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirVisitor.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirVisitor.kt @@ -92,6 +92,7 @@ import org.jetbrains.kotlin.fir.expressions.FirWrappedArgumentExpression import org.jetbrains.kotlin.fir.expressions.FirLambdaArgumentExpression import org.jetbrains.kotlin.fir.expressions.FirSpreadArgumentExpression import org.jetbrains.kotlin.fir.expressions.FirNamedArgumentExpression +import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier import org.jetbrains.kotlin.fir.expressions.FirResolvedReifiedParameterReference import org.jetbrains.kotlin.fir.expressions.FirReturnExpression @@ -300,6 +301,8 @@ abstract class FirVisitor { open fun visitNamedArgumentExpression(namedArgumentExpression: FirNamedArgumentExpression, data: D): R = visitElement(namedArgumentExpression, data) + open fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression, data: D): R = visitElement(varargArgumentsExpression, data) + open fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier, data: D): R = visitElement(resolvedQualifier, data) open fun visitResolvedReifiedParameterReference(resolvedReifiedParameterReference: FirResolvedReifiedParameterReference, data: D): R = visitElement(resolvedReifiedParameterReference, data) diff --git a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirVisitorVoid.kt b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirVisitorVoid.kt index f21e687e687..513ce68d613 100644 --- a/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirVisitorVoid.kt +++ b/compiler/fir/tree/gen/org/jetbrains/kotlin/fir/visitors/FirVisitorVoid.kt @@ -92,6 +92,7 @@ import org.jetbrains.kotlin.fir.expressions.FirWrappedArgumentExpression import org.jetbrains.kotlin.fir.expressions.FirLambdaArgumentExpression import org.jetbrains.kotlin.fir.expressions.FirSpreadArgumentExpression import org.jetbrains.kotlin.fir.expressions.FirNamedArgumentExpression +import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier import org.jetbrains.kotlin.fir.expressions.FirResolvedReifiedParameterReference import org.jetbrains.kotlin.fir.expressions.FirReturnExpression @@ -472,6 +473,10 @@ abstract class FirVisitorVoid : FirVisitor() { visitElement(namedArgumentExpression) } + open fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression) { + visitElement(varargArgumentsExpression) + } + open fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier) { visitElement(resolvedQualifier) } @@ -928,6 +933,10 @@ abstract class FirVisitorVoid : FirVisitor() { visitNamedArgumentExpression(namedArgumentExpression) } + final override fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression, data: Nothing?) { + visitVarargArgumentsExpression(varargArgumentsExpression) + } + final override fun visitResolvedQualifier(resolvedQualifier: FirResolvedQualifier, data: Nothing?) { visitResolvedQualifier(resolvedQualifier) } diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt index c93bddf3854..f30eb0f5c69 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirRenderer.kt @@ -659,6 +659,12 @@ class FirRenderer(builder: StringBuilder) : FirVisitorVoid() { lambdaArgumentExpression.expression.accept(this) } + override fun visitVarargArgumentsExpression(varargArgumentsExpression: FirVarargArgumentsExpression) { + print("vararg(") + varargArgumentsExpression.arguments.renderSeparated() + print(")") + } + override fun visitCall(call: FirCall) { print("(") call.arguments.renderSeparated() diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/FirTreeBuilder.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/FirTreeBuilder.kt index 39013b215aa..9fcb031bc8d 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/FirTreeBuilder.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/FirTreeBuilder.kt @@ -107,6 +107,7 @@ object FirTreeBuilder : AbstractFirTreeBuilder() { val lambdaArgumentExpression = element("LambdaArgumentExpression", Expression, wrappedArgumentExpression) val spreadArgumentExpression = element("SpreadArgumentExpression", Expression, wrappedArgumentExpression) val namedArgumentExpression = element("NamedArgumentExpression", Expression, wrappedArgumentExpression) + val varargArgumentsExpression = element("VarargArgumentsExpression", Expression, expression) val resolvedQualifier = element("ResolvedQualifier", Expression, expression) val resolvedReifiedParameterReference = element("ResolvedReifiedParameterReference", Expression, expression) diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt index bfb870590ed..b4a917faa44 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/NodeConfigurator.kt @@ -426,6 +426,11 @@ object NodeConfigurator : AbstractFieldConfigurator(FirTreeBuild +name } + varargArgumentsExpression.configure { + +fieldList("arguments", expression) + +field("varargElementType", typeRef) + } + resolvedQualifier.configure { +field("packageFqName", fqNameType) +field("relativeClassFqName", fqNameType, nullable = true) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/VarargLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/VarargLowering.kt index 2ee02885c3c..985acc9de83 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/VarargLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/VarargLowering.kt @@ -102,17 +102,20 @@ private class VarargLowering(val context: JvmBackendContext) : FileLoweringPass, context.createJvmIrBuilder(currentScope!!.scope.scopeOwnerSymbol, startOffset, endOffset) private val IrFunctionSymbol.isArrayOf: Boolean - get() = this == context.ir.symbols.arrayOf || owner.isPrimitiveArrayOf + get() = owner.isArrayOf private val IrFunctionSymbol.isEmptyArray: Boolean - get() = owner.name.asString() == "emptyArray" && (owner.parent as? IrPackageFragment)?.fqName == KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME + get() = owner.name.asString() == "emptyArray" && + (owner.parent as? IrPackageFragment)?.fqName == KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME companion object { private val PRIMITIVE_ARRAY_OF_NAMES: Set = (PrimitiveType.values().map { type -> type.name } + UnsignedType.values().map { type -> type.typeName.asString() }) .map { name -> name.toLowerCaseAsciiOnly() + "ArrayOf" }.toSet() + private const val ARRAY_OF_NAME = "arrayOf" - private val IrFunction.isPrimitiveArrayOf: Boolean + + private val IrFunction.isArrayOf: Boolean get() { val parent = when (val directParent = parent) { is IrClass -> directParent.getPackageFragment() ?: return false @@ -120,7 +123,7 @@ private class VarargLowering(val context: JvmBackendContext) : FileLoweringPass, else -> return false } return parent.fqName == KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAME && - name.asString() in PRIMITIVE_ARRAY_OF_NAMES && + name.asString().let { it in PRIMITIVE_ARRAY_OF_NAMES || it == ARRAY_OF_NAME } && extensionReceiverParameter == null && dispatchReceiverParameter == null && valueParameters.size == 1 && diff --git a/compiler/testData/codegen/box/arrays/arrayInstanceOf.kt b/compiler/testData/codegen/box/arrays/arrayInstanceOf.kt index b1b30180468..406b97e57a4 100644 --- a/compiler/testData/codegen/box/arrays/arrayInstanceOf.kt +++ b/compiler/testData/codegen/box/arrays/arrayInstanceOf.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR //test [], get and iterator calls fun test(createIntNotLong: Boolean): String { val a = if (createIntNotLong) IntArray(5) else LongArray(5) diff --git a/compiler/testData/codegen/box/arrays/kt4348.kt b/compiler/testData/codegen/box/arrays/kt4348.kt index 983bba7643d..aba4a1922d9 100644 --- a/compiler/testData/codegen/box/arrays/kt4348.kt +++ b/compiler/testData/codegen/box/arrays/kt4348.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR operator fun String.get(vararg value: Any) : String { return if (value[0] == 44 && value[1] == "example") "OK" else "fail" } diff --git a/compiler/testData/codegen/box/arrays/kt4357.kt b/compiler/testData/codegen/box/arrays/kt4357.kt index 7df00fb7f42..95b92765fa4 100644 --- a/compiler/testData/codegen/box/arrays/kt4357.kt +++ b/compiler/testData/codegen/box/arrays/kt4357.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { val array = intArrayOf(11, 12, 13) val p = array.get(0) diff --git a/compiler/testData/codegen/box/arrays/kt503.kt b/compiler/testData/codegen/box/arrays/kt503.kt index f44355b8ac7..bf5816ddc12 100644 --- a/compiler/testData/codegen/box/arrays/kt503.kt +++ b/compiler/testData/codegen/box/arrays/kt503.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/arrays/kt7288.kt b/compiler/testData/codegen/box/arrays/kt7288.kt index 15293b6a859..2c387e56cf9 100644 --- a/compiler/testData/codegen/box/arrays/kt7288.kt +++ b/compiler/testData/codegen/box/arrays/kt7288.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun test(b: Boolean): String { val a = if (b) IntArray(5) else LongArray(5) if (a is IntArray) { diff --git a/compiler/testData/codegen/box/arrays/kt7338.kt b/compiler/testData/codegen/box/arrays/kt7338.kt index bb4a5d46d8d..82d4ff9d8f5 100644 --- a/compiler/testData/codegen/box/arrays/kt7338.kt +++ b/compiler/testData/codegen/box/arrays/kt7338.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: NATIVE // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not diff --git a/compiler/testData/codegen/box/arrays/varargsWithJava.kt b/compiler/testData/codegen/box/arrays/varargsWithJava.kt index 6b26b6193e7..ce5377fdf63 100644 --- a/compiler/testData/codegen/box/arrays/varargsWithJava.kt +++ b/compiler/testData/codegen/box/arrays/varargsWithJava.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FILE: AT.java diff --git a/compiler/testData/codegen/box/casts/functions/reifiedSafeAsFunKBig.kt b/compiler/testData/codegen/box/casts/functions/reifiedSafeAsFunKBig.kt index 3d0c5f87dec..cbaf223dced 100644 --- a/compiler/testData/codegen/box/casts/functions/reifiedSafeAsFunKBig.kt +++ b/compiler/testData/codegen/box/casts/functions/reifiedSafeAsFunKBig.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/controlStructures/forInArray/forInArrayWithArrayPropertyUpdatedInLoopBody.kt b/compiler/testData/codegen/box/controlStructures/forInArray/forInArrayWithArrayPropertyUpdatedInLoopBody.kt index f2428635849..a86b71e6fb5 100644 --- a/compiler/testData/codegen/box/controlStructures/forInArray/forInArrayWithArrayPropertyUpdatedInLoopBody.kt +++ b/compiler/testData/codegen/box/controlStructures/forInArray/forInArrayWithArrayPropertyUpdatedInLoopBody.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME var xs = intArrayOf(1, 2, 3) diff --git a/compiler/testData/codegen/box/controlStructures/forInArray/forInArrayWithArrayVarUpdatedInLoopBody13.kt b/compiler/testData/codegen/box/controlStructures/forInArray/forInArrayWithArrayVarUpdatedInLoopBody13.kt index 8d3ac484d9b..dc0361b2868 100644 --- a/compiler/testData/codegen/box/controlStructures/forInArray/forInArrayWithArrayVarUpdatedInLoopBody13.kt +++ b/compiler/testData/codegen/box/controlStructures/forInArray/forInArrayWithArrayVarUpdatedInLoopBody13.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // See https://youtrack.jetbrains.com/issue/KT-21354 diff --git a/compiler/testData/codegen/box/controlStructures/forInArray/forInDoubleArrayWithUpcast.kt b/compiler/testData/codegen/box/controlStructures/forInArray/forInDoubleArrayWithUpcast.kt index 7e02d3a5347..8317a8e90e3 100644 --- a/compiler/testData/codegen/box/controlStructures/forInArray/forInDoubleArrayWithUpcast.kt +++ b/compiler/testData/codegen/box/controlStructures/forInArray/forInDoubleArrayWithUpcast.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { testForInFloatArrayWithUpcastToAny() testForInDoubleArrayWithUpcastToAny() diff --git a/compiler/testData/codegen/box/controlStructures/forInArray/forInFieldUpdatedInLoopBody.kt b/compiler/testData/codegen/box/controlStructures/forInArray/forInFieldUpdatedInLoopBody.kt index 8f03e9c352d..592ba5119db 100644 --- a/compiler/testData/codegen/box/controlStructures/forInArray/forInFieldUpdatedInLoopBody.kt +++ b/compiler/testData/codegen/box/controlStructures/forInArray/forInFieldUpdatedInLoopBody.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR var xs: IntArray = intArrayOf(1, 2, 3) get() = field set(ys) { diff --git a/compiler/testData/codegen/box/dataClasses/hashCode/array.kt b/compiler/testData/codegen/box/dataClasses/hashCode/array.kt index 9ecb2d76107..5bc0c0fbff4 100644 --- a/compiler/testData/codegen/box/dataClasses/hashCode/array.kt +++ b/compiler/testData/codegen/box/dataClasses/hashCode/array.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM data class A(val a: IntArray, var b: Array) diff --git a/compiler/testData/codegen/box/lazyCodegen/safeCallAndArray.kt b/compiler/testData/codegen/box/lazyCodegen/safeCallAndArray.kt index b762fda1210..90b61d66b5f 100644 --- a/compiler/testData/codegen/box/lazyCodegen/safeCallAndArray.kt +++ b/compiler/testData/codegen/box/lazyCodegen/safeCallAndArray.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class C { fun calc() : String { return "OK" diff --git a/compiler/testData/codegen/box/regressions/kt2210.kt b/compiler/testData/codegen/box/regressions/kt2210.kt index 0704934eff9..95f4d64882a 100644 --- a/compiler/testData/codegen/box/regressions/kt2210.kt +++ b/compiler/testData/codegen/box/regressions/kt2210.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A(t: Array>) { val a:Array> = t } diff --git a/compiler/testData/codegen/box/regressions/kt2509.kt b/compiler/testData/codegen/box/regressions/kt2509.kt index b91cb59bf2e..10529d6d497 100644 --- a/compiler/testData/codegen/box/regressions/kt2509.kt +++ b/compiler/testData/codegen/box/regressions/kt2509.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { A() return "OK" diff --git a/compiler/testData/codegen/box/reified/arraysReification/instanceOf.kt b/compiler/testData/codegen/box/reified/arraysReification/instanceOf.kt index 92210cf9abb..9f3ab24fc1c 100644 --- a/compiler/testData/codegen/box/reified/arraysReification/instanceOf.kt +++ b/compiler/testData/codegen/box/reified/arraysReification/instanceOf.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: NATIVE // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not diff --git a/compiler/testData/codegen/box/reified/arraysReification/instanceOfArrays.kt b/compiler/testData/codegen/box/reified/arraysReification/instanceOfArrays.kt index 201852e48af..0bc1ad17c58 100644 --- a/compiler/testData/codegen/box/reified/arraysReification/instanceOfArrays.kt +++ b/compiler/testData/codegen/box/reified/arraysReification/instanceOfArrays.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: NATIVE // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not diff --git a/compiler/testData/codegen/box/super/superConstructor/kt17464_arrayOf.kt b/compiler/testData/codegen/box/super/superConstructor/kt17464_arrayOf.kt index 73c6cef1ce8..eb092f89776 100644 --- a/compiler/testData/codegen/box/super/superConstructor/kt17464_arrayOf.kt +++ b/compiler/testData/codegen/box/super/superConstructor/kt17464_arrayOf.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class A(val array: Array) class B : A(arrayOf("OK")) diff --git a/compiler/testData/codegen/box/topLevelPrivate/privateVisibility.kt b/compiler/testData/codegen/box/topLevelPrivate/privateVisibility.kt index 1c4bf19d995..44d0c4b557b 100644 --- a/compiler/testData/codegen/box/topLevelPrivate/privateVisibility.kt +++ b/compiler/testData/codegen/box/topLevelPrivate/privateVisibility.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FULL_JDK diff --git a/compiler/testData/codegen/box/vararg/emptyVarargOfBoxedPrimitiveType.kt b/compiler/testData/codegen/box/vararg/emptyVarargOfBoxedPrimitiveType.kt index 16e37711cfa..abd1b937c92 100644 --- a/compiler/testData/codegen/box/vararg/emptyVarargOfBoxedPrimitiveType.kt +++ b/compiler/testData/codegen/box/vararg/emptyVarargOfBoxedPrimitiveType.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND_FIR: JVM_IR // FILE: emptyVarargOfBoxedPrimitiveType.kt fun box(): String { diff --git a/compiler/testData/codegen/box/vararg/kt1978.kt b/compiler/testData/codegen/box/vararg/kt1978.kt index 5f45dd3e5dd..6d27ec3a311 100644 --- a/compiler/testData/codegen/box/vararg/kt1978.kt +++ b/compiler/testData/codegen/box/vararg/kt1978.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun aa(vararg a : String): String = a[0] fun box(): String { diff --git a/compiler/testData/codegen/box/vararg/kt796_797.kt b/compiler/testData/codegen/box/vararg/kt796_797.kt index d13a4ec63de..ebb6be014c3 100644 --- a/compiler/testData/codegen/box/vararg/kt796_797.kt +++ b/compiler/testData/codegen/box/vararg/kt796_797.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR operator fun Array?.get(i : Int?) = this!!.get(i!!) fun array(vararg t : T) : Array = t as Array diff --git a/compiler/testData/ir/irText/classes/annotationClasses.fir.txt b/compiler/testData/ir/irText/classes/annotationClasses.fir.txt index 3ea534b0a98..a19905c3366 100644 --- a/compiler/testData/ir/irText/classes/annotationClasses.fir.txt +++ b/compiler/testData/ir/irText/classes/annotationClasses.fir.txt @@ -88,11 +88,11 @@ FILE fqName: fileName:/annotationClasses.kt CLASS ANNOTATION_CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4 CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:.Test4 [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final] EXPRESSION_BODY - GET_VAR 'xs: kotlin.IntArray declared in .Test4.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'xs: kotlin.IntArray [vararg] declared in .Test4.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test4) returnType:kotlin.Array correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Test4 diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.fir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.fir.txt index 09c7de9fef5..0d8243df228 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsWithVarargParameters.fir.txt @@ -2,11 +2,11 @@ FILE fqName: fileName:/annotationsWithVarargParameters.kt CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array + VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final] EXPRESSION_BODY - GET_VAR 'xs: kotlin.Array declared in .A.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'xs: kotlin.Array [vararg] declared in .A.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Array correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.A diff --git a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.txt b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.txt index 96856de2107..27aa937cae3 100644 --- a/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/spreadOperatorInAnnotationArguments.fir.txt @@ -2,11 +2,11 @@ FILE fqName: fileName:/spreadOperatorInAnnotationArguments.kt CLASS ANNOTATION_CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array + VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final] EXPRESSION_BODY - GET_VAR 'xs: kotlin.Array declared in .A.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'xs: kotlin.Array [vararg] declared in .A.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Array correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.A diff --git a/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.fir.txt b/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.fir.txt index 89bafceba9a..5968ba82c93 100644 --- a/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/varargsInAnnotationArguments.fir.txt @@ -2,11 +2,11 @@ FILE fqName: fileName:/varargsInAnnotationArguments.kt CLASS ANNOTATION_CLASS name:A1 modality:FINAL visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A1 CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:.A1 [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final] EXPRESSION_BODY - GET_VAR 'xs: kotlin.IntArray declared in .A1.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'xs: kotlin.IntArray [vararg] declared in .A1.' type=kotlin.IntArray origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A1) returnType:kotlin.Array correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.A1 @@ -30,11 +30,11 @@ FILE fqName: fileName:/varargsInAnnotationArguments.kt CLASS ANNOTATION_CLASS name:A2 modality:FINAL visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A2 CONSTRUCTOR visibility:public <> (xs:kotlin.Array) returnType:.A2 [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array + VALUE_PARAMETER name:xs index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array visibility:private [final] EXPRESSION_BODY - GET_VAR 'xs: kotlin.Array declared in .A2.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'xs: kotlin.Array [vararg] declared in .A2.' type=kotlin.Array origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A2) returnType:kotlin.Array correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.A2 @@ -58,11 +58,11 @@ FILE fqName: fileName:/varargsInAnnotationArguments.kt CLASS ANNOTATION_CLASS name:AA modality:FINAL visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AA CONSTRUCTOR visibility:public <> (xs:kotlin.Array<.A1>) returnType:.AA [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.Array<.A1> + VALUE_PARAMETER name:xs index:0 type:kotlin.Array<.A1> varargElementType:.A1 [vararg] PROPERTY name:xs visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:xs type:kotlin.Array.A1> visibility:private [final] EXPRESSION_BODY - GET_VAR 'xs: kotlin.Array<.A1> declared in .AA.' type=kotlin.Array<.A1> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + GET_VAR 'xs: kotlin.Array<.A1> [vararg] declared in .AA.' type=kotlin.Array<.A1> origin=INITIALIZE_PROPERTY_FROM_PARAMETER FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.AA) returnType:kotlin.Array.A1> correspondingProperty: PROPERTY name:xs visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.AA diff --git a/compiler/testData/ir/irText/declarations/parameters/fun.fir.txt b/compiler/testData/ir/irText/declarations/parameters/fun.fir.txt index 9fd890c34d9..289eadc6dd9 100644 --- a/compiler/testData/ir/irText/declarations/parameters/fun.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/fun.fir.txt @@ -13,7 +13,7 @@ FILE fqName: fileName:/fun.kt CONST String type=kotlin.String value="" BLOCK_BODY FUN name:test3 visibility:public modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Unit - VALUE_PARAMETER name:args index:0 type:kotlin.Array + VALUE_PARAMETER name:args index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] BLOCK_BODY FUN name:textExt1 visibility:public modality:FINAL <> ($receiver:kotlin.String, i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:kotlin.String diff --git a/compiler/testData/ir/irText/declarations/parameters/localFun.fir.txt b/compiler/testData/ir/irText/declarations/parameters/localFun.fir.txt index c849f8f9437..ea719090719 100644 --- a/compiler/testData/ir/irText/declarations/parameters/localFun.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/localFun.fir.txt @@ -16,7 +16,7 @@ FILE fqName: fileName:/localFun.kt CONST String type=kotlin.String value="" BLOCK_BODY FUN name:test3 visibility:local modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Unit - VALUE_PARAMETER name:args index:0 type:kotlin.Array + VALUE_PARAMETER name:args index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] BLOCK_BODY FUN name:textExt1 visibility:local modality:FINAL <> ($receiver:kotlin.String, i:kotlin.Int, j:TT of .outer) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:kotlin.String diff --git a/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt b/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt index e70c97f655b..68b8150111a 100644 --- a/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt @@ -2,10 +2,11 @@ FILE fqName: fileName:/arrayAssignment.kt FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:x type:kotlin.IntArray [val] - ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray - CONST Int type=kotlin.Int value=1 - CONST Int type=kotlin.Int value=2 - CONST Int type=kotlin.Int value=3 + 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=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null $this: GET_VAR 'val x: kotlin.IntArray [val] declared in .test' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=1 @@ -17,9 +18,10 @@ FILE fqName: fileName:/arrayAssignment.kt FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in kotlin.IntArray' type=kotlin.Unit origin=null - $this: ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray - CONST Int type=kotlin.Int value=1 - CONST Int type=kotlin.Int value=2 - CONST Int type=kotlin.Int value=3 + $this: 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=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 index: CALL 'public final fun foo (): kotlin.Int declared in ' type=kotlin.Int origin=null value: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt index 92e2042f555..4acd6f85871 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt @@ -2,10 +2,11 @@ FILE fqName: fileName:/arrayAugmentedAssignment1.kt FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.IntArray BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.IntArray declared in ' - ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray - CONST Int type=kotlin.Int value=1 - CONST Int type=kotlin.Int value=2 - CONST Int type=kotlin.Int value=3 + 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=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.Int declared in ' diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt index fe8b7fb6302..e19a38af3a4 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt @@ -98,9 +98,9 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt VALUE_PARAMETER name:newValue index:1 type:kotlin.Int BLOCK_BODY FUN name:withVararg visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withVararg (xs: kotlin.IntArray): kotlin.Int declared in ' + RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' CONST Int type=kotlin.Int value=42 FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt index 76829013e19..a010a63cae6 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt @@ -9,7 +9,7 @@ FILE fqName: fileName:/constructorWithAdaptedArguments.kt CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:.C [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' @@ -35,7 +35,7 @@ FILE fqName: fileName:/constructorWithAdaptedArguments.kt CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:.Outer.Inner [primary] - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' @@ -69,15 +69,15 @@ FILE fqName: fileName:/constructorWithAdaptedArguments.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testConstructor (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public constructor (xs: kotlin.IntArray) [primary] declared in .C' type=kotlin.reflect.KFunction1.C> origin=null reflectionTarget= + FUNCTION_REFERENCE 'public constructor (vararg xs: kotlin.Int) [primary] declared in .C' type=kotlin.reflect.KFunction1.C> origin=null reflectionTarget= FUN name:testInnerClassConstructor visibility:public modality:FINAL <> (outer:.Outer) returnType:IrErrorType VALUE_PARAMETER name:outer index:0 type:.Outer BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testInnerClassConstructor (outer: .Outer): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public constructor (xs: kotlin.IntArray) [primary] declared in .Outer.Inner' type=kotlin.reflect.KFunction1.Outer.Inner> origin=null reflectionTarget= + FUNCTION_REFERENCE 'public constructor (vararg xs: kotlin.Int) [primary] declared in .Outer.Inner' type=kotlin.reflect.KFunction1.Outer.Inner> origin=null reflectionTarget= FUN name:testInnerClassConstructorCapturingOuter visibility:public modality:FINAL <> () returnType:IrErrorType BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testInnerClassConstructorCapturingOuter (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public constructor (xs: kotlin.IntArray) [primary] declared in .Outer.Inner' type=kotlin.reflect.KFunction1.Outer.Inner> origin=null reflectionTarget= + FUNCTION_REFERENCE 'public constructor (vararg xs: kotlin.Int) [primary] declared in .Outer.Inner' type=kotlin.reflect.KFunction1.Outer.Inner> origin=null reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.fir.txt index 795e96307a6..c473fd65747 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.fir.txt @@ -13,9 +13,9 @@ FILE fqName: fileName:/unboundMemberReferenceWithAdaptedArguments.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]' FUN name:foo visibility:public modality:OPEN <> ($this:.A, xs:kotlin.IntArray) returnType:kotlin.Int $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (xs: kotlin.IntArray): kotlin.Int declared in .A' + RETURN type=kotlin.Nothing from='public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A' CONST Int type=kotlin.Int value=1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: @@ -38,9 +38,9 @@ FILE fqName: fileName:/unboundMemberReferenceWithAdaptedArguments.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Obj modality:FINAL visibility:public superTypes:[.A]' FUN name:foo visibility:public modality:FINAL <> ($this:.Obj, xs:kotlin.IntArray) returnType:kotlin.Int $this: VALUE_PARAMETER name: type:.Obj - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (xs: kotlin.IntArray): kotlin.Int declared in .Obj' + RETURN type=kotlin.Nothing from='public final fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .Obj' CONST Int type=kotlin.Int value=1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: @@ -58,13 +58,13 @@ FILE fqName: fileName:/unboundMemberReferenceWithAdaptedArguments.kt FUN name:testUnbound visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public open fun foo (xs: kotlin.IntArray): kotlin.Int declared in .A' type=kotlin.reflect.KFunction2<.A, kotlin.IntArray, kotlin.Int> origin=null reflectionTarget= + FUNCTION_REFERENCE 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A' type=kotlin.reflect.KFunction2<.A, kotlin.IntArray, kotlin.Int> origin=null reflectionTarget= FUN name:testBound visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public open fun foo (xs: kotlin.IntArray): kotlin.Int declared in .A' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= FUN name:testObject visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun foo (xs: kotlin.IntArray): kotlin.Int declared in .Obj' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .Obj' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.fir.txt index db6ee74ca4c..96b5122a665 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.fir.txt @@ -21,11 +21,11 @@ FILE fqName: fileName:/withAdaptationForSam.kt VALUE_PARAMETER name:foo index:0 type:.IFoo BLOCK_BODY FUN name:withVararg visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withVararg (xs: kotlin.IntArray): kotlin.Int declared in ' + RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' CONST Int type=kotlin.Int value=42 FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt index 35f05f7e947..2c7dba5c113 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt @@ -18,9 +18,9 @@ FILE fqName: fileName:/withAdaptedArguments.kt RETURN type=kotlin.Nothing from='public final fun fnWithDefault (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in ' CONST String type=kotlin.String value="abc" FUN name:fnWithVarargs visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.String - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun fnWithVarargs (xs: kotlin.IntArray): kotlin.String declared in ' + RETURN type=kotlin.Nothing from='public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in ' CONST String type=kotlin.String value="abc" CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host @@ -30,9 +30,9 @@ FILE fqName: fileName:/withAdaptedArguments.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN name:importedObjectMemberWithVarargs visibility:public modality:FINAL <> ($this:.Host, xs:kotlin.IntArray) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.Host - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun importedObjectMemberWithVarargs (xs: kotlin.IntArray): kotlin.String declared in .Host' + RETURN type=kotlin.Nothing from='public final fun importedObjectMemberWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in .Host' CONST String type=kotlin.String value="abc" FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: @@ -56,7 +56,7 @@ FILE fqName: fileName:/withAdaptedArguments.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testVararg (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun fnWithVarargs (xs: kotlin.IntArray): kotlin.String declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= FUN name:testCoercionToUnit visibility:public modality:FINAL <> () returnType:IrErrorType BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testCoercionToUnit (): IrErrorType declared in ' @@ -66,4 +66,4 @@ FILE fqName: fileName:/withAdaptedArguments.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testImportedObjectMember (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun importedObjectMemberWithVarargs (xs: kotlin.IntArray): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun importedObjectMemberWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt index e771f4e8c42..4d17bdae85a 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt @@ -13,40 +13,40 @@ FILE fqName: fileName:/withArgumentAdaptationAndReceiver.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' FUN name:withVararg visibility:public modality:FINAL <> ($this:.Host, xs:kotlin.IntArray) returnType:kotlin.String $this: VALUE_PARAMETER name: type:.Host - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in .Host' + RETURN type=kotlin.Nothing from='public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' CONST String type=kotlin.String value="" FUN name:testImplicitThis visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= FUN name:testBoundReceiverLocalVal visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY VAR name:h type:.Host [val] CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Host' type=.Host origin=null ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= FUN name:testBoundReceiverLocalVar visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY VAR name:h type:.Host [var] CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Host' type=.Host origin=null ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= FUN name:testBoundReceiverParameter visibility:public modality:FINAL <> ($this:.Host, h:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host VALUE_PARAMETER name:h index:0 type:.Host BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= FUN name:testBoundReceiverExpression visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (xs: kotlin.IntArray): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt index 8e1c3436649..a312ac42fc7 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt @@ -1,11 +1,11 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt FUN name:sum visibility:public modality:FINAL <> (args:kotlin.IntArray) returnType:kotlin.Int - VALUE_PARAMETER name:args index:0 type:kotlin.IntArray + VALUE_PARAMETER name:args index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY VAR name:result type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.IntArray [val] - GET_VAR 'args: kotlin.IntArray declared in .sum' type=kotlin.IntArray origin=null + GET_VAR 'args: kotlin.IntArray [vararg] declared in .sum' type=kotlin.IntArray origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.IntIterator [val] CALL 'public final fun iterator (): kotlin.collections.IntIterator [operator] declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null $this: GET_VAR 'val tmp_0: kotlin.IntArray [val] declared in .sum' type=kotlin.IntArray origin=null @@ -20,26 +20,28 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'var result: kotlin.Int [var] declared in .sum' type=kotlin.Int origin=null other: GET_VAR 'val arg: kotlin.Int [val] declared in .sum' type=kotlin.Int origin=null - RETURN type=kotlin.Nothing from='public final fun sum (args: kotlin.IntArray): kotlin.Int declared in ' + RETURN type=kotlin.Nothing from='public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' GET_VAR 'var result: kotlin.Int [var] declared in .sum' type=kotlin.Int origin=null FUN name:nsum visibility:public modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Int - VALUE_PARAMETER name:args index:0 type:kotlin.Array + VALUE_PARAMETER name:args index:0 type:kotlin.Array varargElementType:kotlin.Number [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun nsum (args: kotlin.Array): kotlin.Int declared in ' - CALL 'public final fun sum (args: kotlin.IntArray): kotlin.Int declared in ' type=kotlin.Int origin=null - args: CONSTRUCTOR_CALL 'public constructor (size: kotlin.Int, init: kotlin.Function1) declared in kotlin.IntArray' type=kotlin.IntArray origin=null - size: CALL 'public final fun (): kotlin.Int declared in kotlin.Array' type=kotlin.Int origin=null - $this: GET_VAR 'args: kotlin.Array declared in .nsum' type=kotlin.Array origin=null - init: FUN_EXPR type=kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Int - VALUE_PARAMETER name:it index:0 type:kotlin.Int - BLOCK_BODY - CALL 'public abstract fun toInt (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null - $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Number [operator] declared in kotlin.Array' type=kotlin.Number origin=null - $this: GET_VAR 'args: kotlin.Array declared in .nsum' type=kotlin.Array origin=null - index: GET_VAR 'it: kotlin.Int declared in .nsum.' type=kotlin.Int origin=null + RETURN type=kotlin.Nothing from='public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in ' + CALL 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null + args: VARARG type=kotlin.IntArray varargElementType=kotlin.Int + SPREAD_ELEMENT + CONSTRUCTOR_CALL 'public constructor (size: kotlin.Int, init: kotlin.Function1) declared in kotlin.IntArray' type=kotlin.IntArray origin=null + size: CALL 'public final fun (): kotlin.Int declared in kotlin.Array' type=kotlin.Int origin=null + $this: GET_VAR 'args: kotlin.Array [vararg] declared in .nsum' type=kotlin.Array origin=null + init: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Int + VALUE_PARAMETER name:it index:0 type:kotlin.Int + BLOCK_BODY + CALL 'public abstract fun toInt (): kotlin.Int declared in kotlin.Number' type=kotlin.Int origin=null + $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Number [operator] declared in kotlin.Array' type=kotlin.Number origin=null + $this: GET_VAR 'args: kotlin.Array [vararg] declared in .nsum' type=kotlin.Array origin=null + index: GET_VAR 'it: kotlin.Int declared in .nsum.' type=kotlin.Int origin=null FUN name:zap visibility:public modality:FINAL <> (b:kotlin.Array, k:kotlin.Int) returnType:kotlin.Unit - VALUE_PARAMETER name:b index:0 type:kotlin.Array + VALUE_PARAMETER name:b index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] VALUE_PARAMETER name:k index:1 type:kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value=42 @@ -59,16 +61,16 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt FUN name:testPlainArgs visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun sum (args: kotlin.IntArray): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= FUN name:testPrimitiveArrayAsVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun usePrimitiveArray (fn: kotlin.Function1): kotlin.Unit declared in ' type=kotlin.Unit origin=null - fn: FUNCTION_REFERENCE 'public final fun sum (args: kotlin.IntArray): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + fn: FUNCTION_REFERENCE 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= FUN name:testArrayAsVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun nsum (args: kotlin.Array): kotlin.Int declared in ' type=kotlin.reflect.KFunction1, kotlin.Int> origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun nsum (vararg args: kotlin.Number): kotlin.Int declared in ' type=kotlin.reflect.KFunction1, kotlin.Int> origin=null reflectionTarget= FUN name:testArrayAndDefaults visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun zap (b: kotlin.Array, k: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KFunction2, kotlin.Int, kotlin.Unit> origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun zap (vararg b: kotlin.String, k: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KFunction2, kotlin.Int, kotlin.Unit> origin=null reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt index 181a3eb5a31..5234f4673c7 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt @@ -18,19 +18,20 @@ FILE fqName: fileName:/samConversionInVarargs.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:useVararg visibility:public modality:FINAL <> (foos:kotlin.Array<.IFoo>) returnType:kotlin.Unit - VALUE_PARAMETER name:foos index:0 type:kotlin.Array<.IFoo> + VALUE_PARAMETER name:foos index:0 type:kotlin.Array<.IFoo> varargElementType:.IFoo [vararg] BLOCK_BODY FUN name:testLambda visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - CALL 'public final fun useVararg (foos: kotlin.Array<.IFoo>): kotlin.Unit declared in ' type=kotlin.Unit origin=null - foos: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + ERROR_CALL 'Cannot bind 2 arguments to useVararg call with 1 parameters' type=kotlin.Unit + FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:kotlin.Int BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + VARARG type=kotlin.Array<.IFoo> varargElementType=.IFoo FUN name:testSeveralLambdas visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Cannot bind 3 arguments to useVararg call with 1 parameters' type=kotlin.Unit + ERROR_CALL 'Cannot bind 4 arguments to useVararg call with 1 parameters' type=kotlin.Unit FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name:it index:0 type:kotlin.Int @@ -46,12 +47,13 @@ FILE fqName: fileName:/samConversionInVarargs.kt VALUE_PARAMETER name:it index:0 type:kotlin.Int BLOCK_BODY GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + VARARG type=kotlin.Array<.IFoo> varargElementType=.IFoo FUN name:withVarargOfInt visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.String - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun withVarargOfInt (xs: kotlin.IntArray): kotlin.String declared in ' + RETURN type=kotlin.Nothing from='public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' CONST String type=kotlin.String value="" FUN name:testAdaptedCR visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVarargOfInt (xs: kotlin.IntArray): kotlin.String declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.fir.txt index dc4339cd8f5..e3c97644522 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionOnCallableReference.fir.txt @@ -19,9 +19,9 @@ FILE fqName: fileName:/samConversionOnCallableReference.kt FUN name:foo0 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY FUN name:foo1 visibility:public modality:FINAL <> (xs:kotlin.IntArray) returnType:kotlin.Int - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo1 (xs: kotlin.IntArray): kotlin.Int declared in ' + RETURN type=kotlin.Nothing from='public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' CONST Int type=kotlin.Int value=1 FUN name:use visibility:public modality:FINAL <> (r:.KRunnable) returnType:kotlin.Unit VALUE_PARAMETER name:r index:0 type:.KRunnable @@ -35,7 +35,7 @@ FILE fqName: fileName:/samConversionOnCallableReference.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testSamCosntructorOnAdapted (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun foo1 (xs: kotlin.IntArray): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= FUN name:testSamConversion visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (r: .KRunnable): kotlin.Unit declared in ' type=kotlin.Unit origin=null @@ -43,4 +43,4 @@ FILE fqName: fileName:/samConversionOnCallableReference.kt FUN name:testSamConversionOnAdapted visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun foo1 (xs: kotlin.IntArray): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + FUNCTION_REFERENCE 'public final fun foo1 (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt index 0cbdea60a0c..dbf0effdebf 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt @@ -17,10 +17,11 @@ FILE fqName: fileName:/incrementDecrement.kt PROPERTY name:arr visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:arr type:kotlin.IntArray visibility:private [final,static] EXPRESSION_BODY - ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray - CONST Int type=kotlin.Int value=1 - CONST Int type=kotlin.Int value=2 - CONST Int type=kotlin.Int value=3 + 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=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.IntArray correspondingProperty: PROPERTY name:arr visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/kt28456.fir.txt b/compiler/testData/ir/irText/expressions/kt28456.fir.txt index 4e17414c93d..25bcce795e7 100644 --- a/compiler/testData/ir/irText/expressions/kt28456.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456.fir.txt @@ -20,9 +20,9 @@ FILE fqName: fileName:/kt28456.kt $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:get visibility:public modality:FINAL <> ($receiver:.A, xs:kotlin.IntArray) returnType:kotlin.Int [operator] $receiver: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray + VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun get (xs: kotlin.IntArray): kotlin.Int [operator] declared in ' + RETURN type=kotlin.Nothing from='public final fun get (vararg xs: kotlin.Int): kotlin.Int [operator] declared in ' CONST Int type=kotlin.Int value=0 FUN name:set visibility:public modality:FINAL <> ($receiver:.A, i:kotlin.Int, j:kotlin.Int, v:kotlin.Int) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:.A @@ -44,9 +44,11 @@ FILE fqName: fileName:/kt28456.kt RETURN type=kotlin.Nothing from='public final fun testPostfixIncrement (a: .A): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] - ERROR_CALL 'Cannot bind 2 arguments to get call with 1 parameters' type=kotlin.Int - CONST Int type=kotlin.Int value=1 - CONST Int type=kotlin.Int value=2 + CALL 'public final fun get (vararg xs: kotlin.Int): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null + $receiver: GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null + xs: 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 set (i: kotlin.Int, j: kotlin.Int, v: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null $receiver: GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null i: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/kt28456a.fir.txt b/compiler/testData/ir/irText/expressions/kt28456a.fir.txt index c17a1335c4e..5d4746621d2 100644 --- a/compiler/testData/ir/irText/expressions/kt28456a.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456a.fir.txt @@ -20,7 +20,7 @@ FILE fqName: fileName:/kt28456a.kt $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:set visibility:public modality:FINAL <> ($receiver:.A, i:kotlin.IntArray, v:kotlin.Int) returnType:kotlin.Unit [operator] $receiver: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:i index:0 type:kotlin.IntArray + VALUE_PARAMETER name:i index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] VALUE_PARAMETER name:v index:1 type:kotlin.Int BLOCK_BODY FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt index 79c9ed06a43..fc3f4802a6f 100644 --- a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt @@ -78,7 +78,7 @@ FILE fqName: fileName:/signedToUnsignedConversions_test.kt VALUE_PARAMETER name:u index:0 type:kotlin.ULong BLOCK_BODY FUN name:takeUBytes visibility:public modality:FINAL <> (u:kotlin.Array) returnType:kotlin.Unit - VALUE_PARAMETER name:u index:0 type:kotlin.Array + VALUE_PARAMETER name:u index:0 type:kotlin.Array varargElementType:kotlin.UByte [vararg] BLOCK_BODY FUN name:takeLong visibility:public modality:FINAL <> (l:kotlin.Long) returnType:kotlin.Unit VALUE_PARAMETER name:l index:0 type:kotlin.Long diff --git a/compiler/testData/ir/irText/expressions/vararg.fir.txt b/compiler/testData/ir/irText/expressions/vararg.fir.txt index 018d35a4ca3..1d876b445ca 100644 --- a/compiler/testData/ir/irText/expressions/vararg.fir.txt +++ b/compiler/testData/ir/irText/expressions/vararg.fir.txt @@ -2,7 +2,7 @@ FILE fqName: fileName:/vararg.kt PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Array visibility:private [final,static] EXPRESSION_BODY - CALL 'public final fun arrayOf (elements: kotlin.Array): kotlin.Array [inline] declared in kotlin' type=kotlin.Array origin=null + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array origin=null : kotlin.String FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Array correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] @@ -12,10 +12,12 @@ FILE fqName: fileName:/vararg.kt PROPERTY name:test2 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Array visibility:private [final,static] EXPRESSION_BODY - ERROR_CALL 'Cannot bind 3 arguments to arrayOf call with 1 parameters' type=kotlin.Array - CONST String type=kotlin.String value="1" - CONST String type=kotlin.String value="2" - CONST String type=kotlin.String value="3" + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array origin=null + : kotlin.String + elements: VARARG type=kotlin.Array varargElementType=kotlin.String + CONST String type=kotlin.String value="1" + CONST String type=kotlin.String value="2" + CONST String type=kotlin.String value="3" FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Array correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt deleted file mode 100644 index 9f1c0963612..00000000000 --- a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.fir.txt +++ /dev/null @@ -1,27 +0,0 @@ -FILE fqName: fileName:/varargWithImplicitCast.kt - FUN name:testScalar visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.IntArray - VALUE_PARAMETER name:a index:0 type:kotlin.Any - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Int - GET_VAR 'a: kotlin.Any declared in .testScalar' type=kotlin.Any origin=null - then: RETURN type=kotlin.Nothing from='public final fun testScalar (a: kotlin.Any): kotlin.IntArray declared in ' - CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null - RETURN type=kotlin.Nothing from='public final fun testScalar (a: kotlin.Any): kotlin.IntArray declared in ' - CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null - elements: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int - GET_VAR 'a: kotlin.Any declared in .testScalar' type=kotlin.Any origin=null - FUN name:testSpread visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.IntArray - VALUE_PARAMETER name:a index:0 type:kotlin.Any - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.IntArray - GET_VAR 'a: kotlin.Any declared in .testSpread' type=kotlin.Any origin=null - then: RETURN type=kotlin.Nothing from='public final fun testSpread (a: kotlin.Any): kotlin.IntArray declared in ' - CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null - RETURN type=kotlin.Nothing from='public final fun testSpread (a: kotlin.Any): kotlin.IntArray declared in ' - CALL 'public final fun intArrayOf (elements: kotlin.IntArray): kotlin.IntArray declared in kotlin' type=kotlin.IntArray origin=null - elements: TYPE_OP type=kotlin.IntArray origin=IMPLICIT_CAST typeOperand=kotlin.IntArray - GET_VAR 'a: kotlin.Any declared in .testSpread' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.kt b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.kt index d32a2e916cc..e2ac9381d3f 100644 --- a/compiler/testData/ir/irText/expressions/varargWithImplicitCast.kt +++ b/compiler/testData/ir/irText/expressions/varargWithImplicitCast.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + fun testScalar(a: Any): IntArray { if (a !is Int) return intArrayOf() return intArrayOf(a) diff --git a/compiler/testData/ir/irText/types/intersectionType1_NI.fir.txt b/compiler/testData/ir/irText/types/intersectionType1_NI.fir.txt index 5b007a6cf97..b3c69d88c1b 100644 --- a/compiler/testData/ir/irText/types/intersectionType1_NI.fir.txt +++ b/compiler/testData/ir/irText/types/intersectionType1_NI.fir.txt @@ -52,15 +52,17 @@ FILE fqName: fileName:/intersectionType1_NI.kt FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Array<.In> [val] - CALL 'public final fun arrayOf (elements: kotlin.Array): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null : .In - elements: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null - : kotlin.Int + elements: VARARG type=kotlin.Array.In> varargElementType=.In + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null + : kotlin.Int VAR name:a2 type:kotlin.Array<.In> [val] - CALL 'public final fun arrayOf (elements: kotlin.Array): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null : .In - elements: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null - : kotlin.String + elements: VARARG type=kotlin.Array.In> varargElementType=.In + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null + : kotlin.String CALL 'public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null : kotlin.Int a: GET_VAR 'val a1: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null diff --git a/compiler/testData/ir/irText/types/intersectionType1_OI.fir.txt b/compiler/testData/ir/irText/types/intersectionType1_OI.fir.txt index b1c4edd3083..903e4981a63 100644 --- a/compiler/testData/ir/irText/types/intersectionType1_OI.fir.txt +++ b/compiler/testData/ir/irText/types/intersectionType1_OI.fir.txt @@ -52,15 +52,17 @@ FILE fqName: fileName:/intersectionType1_OI.kt FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a1 type:kotlin.Array<.In> [val] - CALL 'public final fun arrayOf (elements: kotlin.Array): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null : .In - elements: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null - : kotlin.Int + elements: VARARG type=kotlin.Array.In> varargElementType=.In + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null + : kotlin.Int VAR name:a2 type:kotlin.Array<.In> [val] - CALL 'public final fun arrayOf (elements: kotlin.Array): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null : .In - elements: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null - : kotlin.String + elements: VARARG type=kotlin.Array.In> varargElementType=.In + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null + : kotlin.String CALL 'public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null : kotlin.Int a: GET_VAR 'val a1: kotlin.Array<.In> [val] declared in .test' type=kotlin.Array<.In> origin=null diff --git a/idea/testData/fir/multiModule/basicWithPrimitiveJava/jvm/jvm.txt b/idea/testData/fir/multiModule/basicWithPrimitiveJava/jvm/jvm.txt index c41815a836d..baafde5aed3 100644 --- a/idea/testData/fir/multiModule/basicWithPrimitiveJava/jvm/jvm.txt +++ b/idea/testData/fir/multiModule/basicWithPrimitiveJava/jvm/jvm.txt @@ -7,7 +7,7 @@ FILE: jvm.kt public final fun test(): R|kotlin/Unit| { lval res1: R|kotlin/Boolean| = this@R|/A|.R|/Some.foo|(Int(1)) lval res2: R|kotlin/Boolean| = this@R|/A|.R|/Some.foo|(Int(1).R|kotlin/Int.unaryMinus|()) - lval res3: R|ft!>, kotlin/Array!>?>!| = this@R|/A|.R|/Some.bar|(R|kotlin/intArrayOf|(Int(0), Int(2), Int(2).R|kotlin/Int.unaryMinus|())) + lval res3: R|ft!>, kotlin/Array!>?>!| = this@R|/A|.R|/Some.bar|(R|kotlin/intArrayOf|(vararg(Int(0), Int(2)), Int(2).R|kotlin/Int.unaryMinus|())) } } diff --git a/idea/testData/fir/multiModule/withStdlib/jvm_dep(stdlib)/Some.txt b/idea/testData/fir/multiModule/withStdlib/jvm_dep(stdlib)/Some.txt index 58772865a94..c6ea7141d91 100644 --- a/idea/testData/fir/multiModule/withStdlib/jvm_dep(stdlib)/Some.txt +++ b/idea/testData/fir/multiModule/withStdlib/jvm_dep(stdlib)/Some.txt @@ -1,3 +1,3 @@ FILE: Some.kt - public final val someList: R|kotlin/collections/List| = R|kotlin/collections/listOf|(Int(1), Int(2), Int(3)) + public final val someList: R|kotlin/collections/List| = R|kotlin/collections/listOf|(vararg(Int(1), Int(2), Int(3))) public get(): R|kotlin/collections/List|