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 332e9d9a482..2f70ede1d88 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 @@ -14,6 +14,7 @@ import org.jetbrains.kotlin.fir.references.builder.buildResolvedCallableReferenc import org.jetbrains.kotlin.fir.references.builder.buildResolvedNamedReference import org.jetbrains.kotlin.fir.resolve.calls.Candidate import org.jetbrains.kotlin.fir.resolve.calls.FirNamedReferenceWithCandidate +import org.jetbrains.kotlin.fir.resolve.calls.varargElementType import org.jetbrains.kotlin.fir.resolve.constructFunctionalTypeRef import org.jetbrains.kotlin.fir.resolve.inference.isBuiltinFunctionalType import org.jetbrains.kotlin.fir.resolve.inference.isSuspendFunctionType @@ -279,7 +280,11 @@ class FirCallCompletionResultsWriterTransformer( private fun Candidate.createArgumentsMapping(): ExpectedArgumentType? { return argumentMapping?.map { (argument, valueParameter) -> - val expectedType = valueParameter.returnTypeRef.substitute(this) + val expectedType = if (valueParameter.isVararg) { + valueParameter.returnTypeRef.substitute(this).varargElementType(session) + } else { + valueParameter.returnTypeRef.substitute(this) + } argument.unwrapArgument() to expectedType }?.toMap()?.toExpectedType() } diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedDownTo.kt index 7c11bdd5cc8..ac6b7bfda7a 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedRange.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedRange.kt index 323720d9252..6a95d0cefe2 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/inexactSteppedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/openRange.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/openRange.kt index 285e272d7fc..9a815778fc1 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/openRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/openRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/reversedBackSequence.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/reversedBackSequence.kt index 6a5916cb14a..a0205a86024 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/reversedBackSequence.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/reversedBackSequence.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/reversedInexactSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/reversedInexactSteppedDownTo.kt index 97025b6b66a..fe5e2843db4 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/reversedInexactSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/reversedInexactSteppedDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/reversedRange.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/reversedRange.kt index 2ee10a014fa..d11b0242c84 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/reversedRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/reversedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/reversedSimpleSteppedRange.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/reversedSimpleSteppedRange.kt index bf3b7c4cc3f..28e9e494f07 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/reversedSimpleSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/reversedSimpleSteppedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/simpleDownTo.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/simpleDownTo.kt index 0c88e25b19a..ba82cbff8d6 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/simpleDownTo.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/simpleDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/simpleRange.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/simpleRange.kt index 39dc4f6a464..d7812817982 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/simpleRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/simpleRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/simpleRangeWithNonConstantEnds.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/simpleRangeWithNonConstantEnds.kt index 1ed76abe1d5..f46d7ce9f96 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/simpleRangeWithNonConstantEnds.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/simpleRangeWithNonConstantEnds.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedDownTo.kt index 15a9e1dd160..6f9fb59b9e6 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedRange.kt b/compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedRange.kt index 350a4cc3a28..f7e218327e3 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/expression/simpleSteppedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedDownTo.kt index 9e171028fca..017cfa2c18d 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedRange.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedRange.kt index b84f756a4e9..46c75e303e8 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/inexactSteppedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/openRange.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/openRange.kt index 201b0d25a3a..1e56cfc81db 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/openRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/openRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/reversedBackSequence.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/reversedBackSequence.kt index 892df38fb9c..f933445fb51 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/reversedBackSequence.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/reversedBackSequence.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/reversedInexactSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/reversedInexactSteppedDownTo.kt index 716d7f4526c..b7c37de4af8 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/reversedInexactSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/reversedInexactSteppedDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/reversedRange.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/reversedRange.kt index fa1cfad1a63..4fe0e8bc9d7 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/reversedRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/reversedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/reversedSimpleSteppedRange.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/reversedSimpleSteppedRange.kt index 99b8be43b98..c8c3e4dd741 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/reversedSimpleSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/reversedSimpleSteppedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/simpleDownTo.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/simpleDownTo.kt index 3743ce5c2e4..1e0d09523d0 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/simpleDownTo.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/simpleDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/simpleRange.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/simpleRange.kt index 13d0ce94d21..7538c5a1630 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/simpleRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/simpleRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/simpleRangeWithNonConstantEnds.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/simpleRangeWithNonConstantEnds.kt index 7cb52a13874..3769013108f 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/simpleRangeWithNonConstantEnds.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/simpleRangeWithNonConstantEnds.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedDownTo.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedDownTo.kt index ae344899d81..bc2ede6762a 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedDownTo.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedDownTo.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedRange.kt b/compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedRange.kt index 0deb5752b12..feffef146e5 100644 --- a/compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedRange.kt +++ b/compiler/testData/codegen/box/ranges/unsigned/literal/simpleSteppedRange.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // Auto-generated by org.jetbrains.kotlin.generators.tests.GenerateRangesCodegenTestData. DO NOT EDIT! // WITH_RUNTIME