[FIR] Properly handle vararg remapping even if ConeInapplicableCandidateError
^KT-67609 Fixed
Review: https://jetbrains.team/p/kt/reviews/15692/timeline
Other related tests:
- compiler/testData/diagnostics/tests/inference/builderInference/invalidateKeys.kt
- compiler/testData/diagnostics/tests/inference/builderInference/regresssions/exponentialErrorsInCSInitial.kt
- compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/stubTypeReceiverRestriction.kt
- compiler/testData/diagnostics/tests/inference/builderInference/stubTypes/stubTypeReceiverRestrictionDisabled.kt
- compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.kt
- compiler/testData/diagnostics/tests/varargs
- compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsInDifferentPositions.kt
- compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsMixed.kt
Related tests in intellij:
- org.jetbrains.fir.uast.test.FirLegacyUastResolveEverythingTestGenerated.testAnnotationComplex
- org.jetbrains.fir.uast.test.FirUastApiTest$Legacy.testAnnotationComplex
- org.jetbrains.kotlin.idea.k2.codeinsight.fixes.HighLevelQuickFixTestGenerated$ReplaceWithArrayCallInAnnotation.testReplaceSingleElementInNamedForm
- org.jetbrains.kotlin.idea.k2.codeinsight.fixes.HighLevelQuickFixTestGenerated$ReplaceWithArrayCallInAnnotation.testReplaceForbiddenAssignmentWithArrayLiteral
- org.jetbrains.kotlin.idea.k2.codeinsight.fixes.HighLevelQuickFixTestGenerated$SurroundWithArrayOfForNamedArgumentsToVarargs.testSimpleNamedArgumentToVararg
- org.jetbrains.kotlin.idea.k2.codeinsight.fixes.HighLevelQuickFixTestGenerated$SurroundWithArrayOfForNamedArgumentsToVarargs.testSurroundWithSpreadForConstructorCall
- org.jetbrains.kotlin.idea.k2.codeinsight.fixes.HighLevelQuickFixTestGenerated$SurroundWithArrayOfForNamedArgumentsToVarargs.testOnlyShortenInsertedArrayOfCall
- org.jetbrains.kotlin.idea.k2.codeinsight.fixes.HighLevelQuickFixTestGenerated$SurroundWithArrayOfForNamedArgumentsToVarargs.testReplaceToArrayOfPrimitiveTypes
- org.jetbrains.fir.uast.test.FirLegacyUastDeclarationTestGenerated.testAnnotationComplex
- org.jetbrains.fir.uast.test.FirLegacyUastTypesTestGenerated.testAnnotationComplex
- org.jetbrains.fir.uast.test.FirLegacyUastValuesTestGenerated.testAnnotationComplex
Cause of the exception: ConeInapplicableCandidateError happens
(calleeReference.isError is true) and because of that handleVarargs
wasn't invoked => two arguments were not wrapped into
FirVarargArgumentsExpression.
The fix is to call handleVarargs even when error happens.
The tricky part of the implementation is that happy-case
(buildResolvedArgumentList/FirResolvedArgumentList) and error-case
(buildArgumentListForErrorCall/FirResolvedArgumentListForErrorCall) have
different format for argToParam mappings.
error-case mapping expects to contain null for problematic arguments.
That's what buildArgumentListForErrorCall was responsible for. After
this commit, the logic became backed into remapArgumentsWithVararg and
handleVarargs (which changed its name). And logic for
buildArgumentListForErrorCall and buildResolvedArgumentList became
uniform
argumentList variable inside remapArgumentsWithVararg got extracted
two stacktraces up into a parameter
'instanceof FirErrorNamedReference' check got replaced with
'instanceof FirResolvedErrorReference'. If I don't do this, then
REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_FUNCTION gets reporeted in
more tests. I don't know what's the difference between
FirErrorNamedReference and FirResolvedErrorReference, but I assume that
it essentially was a duck typing
The change in FirAnnotationValueConverter is needed to keep
FirUastApiTest$Legacy.testAnnotationComplex green. FIR for red code now
have a different structure. A parameter in code like this:
foo(varargParameter = nonArrayExpression)
is now parsed as FirSpreadArgumentExpression. See the implementation
of remapArgumentsWithVararg. All named arguments are implicitly wrapped
into a FirSpreadArgumentExpression (which makes some sense)
diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/evaluate/FirAnnotationValueConverter.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/evaluate/FirAnnotationValueConverter.kt
index 88238c1..e878905 100644
--- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/evaluate/FirAnnotationValueConverter.kt
+++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/evaluate/FirAnnotationValueConverter.kt
@@ -78,8 +78,8 @@
for (expr in this@convertVarargsExpression) {
val converted = expr.convertConstantExpression(builder) ?: continue
- if (expr is FirSpreadArgumentExpression || expr is FirNamedArgumentExpression) {
- addAll((converted as KtArrayAnnotationValue).values)
+ if ((expr is FirSpreadArgumentExpression || expr is FirNamedArgumentExpression) && converted is KtArrayAnnotationValue) {
+ addAll(converted.values)
} else {
add(converted)
}
diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/compilerRequiredAnnotationConflict.txt b/analysis/low-level-api-fir/testData/lazyResolve/classes/compilerRequiredAnnotationConflict.txt
index 51fbc43..798d211 100644
--- a/analysis/low-level-api-fir/testData/lazyResolve/classes/compilerRequiredAnnotationConflict.txt
+++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/compilerRequiredAnnotationConflict.txt
@@ -368,11 +368,11 @@
LAZY_super<R|kotlin/Any|>
}
- @R|kotlin/annotation/Target|[Types](allowedTargets = Q|Some.AnnotationTarget|.<
+ @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|Some.AnnotationTarget|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.CLASS
- compiler arguments stage: FirEnumEntrySymbol /Some.AnnotationTarget.CLASS
- >#) public final [ResolvedTo(ANNOTATION_ARGUMENTS)] annotation class Ann : R|kotlin/Annotation| {
+ >#)) public final [ResolvedTo(ANNOTATION_ARGUMENTS)] annotation class Ann : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
LAZY_super<R|kotlin/Any|>
}
@@ -405,11 +405,11 @@
LAZY_super<R|kotlin/Any|>
}
- @R|kotlin/annotation/Target|[Types](allowedTargets = Q|Some.AnnotationTarget|.<
+ @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|Some.AnnotationTarget|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.CLASS
- compiler arguments stage: FirEnumEntrySymbol /Some.AnnotationTarget.CLASS
- >#) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
+ >#)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
super<R|kotlin/Any|>()
}
@@ -442,11 +442,11 @@
super<R|kotlin/Any|>()
}
- @R|kotlin/annotation/Target|[Types](allowedTargets = Q|Some.AnnotationTarget|.<
+ @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(Q|Some.AnnotationTarget|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.CLASS
- compiler arguments stage: FirEnumEntrySymbol /Some.AnnotationTarget.CLASS
- >#) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
+ >#)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
super<R|kotlin/Any|>()
}
diff --git a/analysis/low-level-api-fir/testData/lazyResolve/classes/compilerRequiredAnnotationConflict2.txt b/analysis/low-level-api-fir/testData/lazyResolve/classes/compilerRequiredAnnotationConflict2.txt
index cefe27a..a21a995 100644
--- a/analysis/low-level-api-fir/testData/lazyResolve/classes/compilerRequiredAnnotationConflict2.txt
+++ b/analysis/low-level-api-fir/testData/lazyResolve/classes/compilerRequiredAnnotationConflict2.txt
@@ -214,11 +214,11 @@
LAZY_super<R|kotlin/Any|>
}
- @R|kotlin/annotation/Target|[Types](allowedTargets = this@R|/Some|.<
+ @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(this@R|/Some|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.FIELD
- compiler arguments stage: FirPropertySymbol /Some.FIELD
- >#) public final [ResolvedTo(ANNOTATION_ARGUMENTS)] annotation class Ann : R|kotlin/Annotation| {
+ >#)) public final [ResolvedTo(ANNOTATION_ARGUMENTS)] annotation class Ann : R|kotlin/Annotation| {
public? [ResolvedTo(RAW_FIR)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
LAZY_super<R|kotlin/Any|>
}
@@ -237,11 +237,11 @@
LAZY_super<R|kotlin/Any|>
}
- @R|kotlin/annotation/Target|[Types](allowedTargets = this@R|/Some|.<
+ @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(this@R|/Some|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.FIELD
- compiler arguments stage: FirPropertySymbol /Some.FIELD
- >#) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
+ >#)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
super<R|kotlin/Any|>()
}
@@ -260,11 +260,11 @@
super<R|kotlin/Any|>()
}
- @R|kotlin/annotation/Target|[Types](allowedTargets = this@R|/Some|.<
+ @R|kotlin/annotation/Target|[Types](allowedTargets = vararg(this@R|/Some|.<
Annotation symbol resolved differently on compiler annotation and symbols stages:
- compiler annotations: FirEnumEntrySymbol kotlin/annotation/AnnotationTarget.FIELD
- compiler arguments stage: FirPropertySymbol /Some.FIELD
- >#) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
+ >#)) public final [ResolvedTo(BODY_RESOLVE)] annotation class Ann : R|kotlin/Annotation| {
public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=Ann] constructor(): R|Some.Ann| {
super<R|kotlin/Any|>()
}
diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java
index db8c65e..b03f1ec 100644
--- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java
+++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java
@@ -24129,6 +24129,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java
index 24f3ff0..8802da8 100644
--- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java
+++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java
@@ -24129,6 +24129,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfAnnotations.fir.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfAnnotations.fir.txt
index dd1b628..c150960 100644
--- a/compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfAnnotations.fir.txt
+++ b/compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfAnnotations.fir.txt
@@ -35,7 +35,7 @@
public get(): R|kotlin/Int|
}
- @R|AnnVarargs|(x = Int(1), y = Int(2)) public final class B : R|kotlin/Any| {
+ @R|AnnVarargs|(x = Int(1), y = vararg(String(a), String(b), String(c), Int(2))) public final class B : R|kotlin/Any| {
public constructor(): R|B| {
super<R|kotlin/Any|>()
}
diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/default.fir.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/default.fir.txt
index 7c6ee02..93f9f3e 100644
--- a/compiler/fir/analysis-tests/testData/resolve/arguments/default.fir.txt
+++ b/compiler/fir/analysis-tests/testData/resolve/arguments/default.fir.txt
@@ -19,5 +19,5 @@
R|/baz|(Int(1))
R|/baz|(Int(1), vararg(String(my), String(yours)))
R|/baz|(Int(1), Boolean(true))
- R|/baz<Inapplicable(INAPPLICABLE): /baz>#|(Int(0), String(), Boolean(false))
+ R|/baz<Inapplicable(INAPPLICABLE): /baz>#|(Int(0), vararg(String(), Boolean(false)))
}
diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/javaAnnotationsWithArrayValue.fir.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/javaAnnotationsWithArrayValue.fir.txt
index dcf4645..959755e 100644
--- a/compiler/fir/analysis-tests/testData/resolve/arguments/javaAnnotationsWithArrayValue.fir.txt
+++ b/compiler/fir/analysis-tests/testData/resolve/arguments/javaAnnotationsWithArrayValue.fir.txt
@@ -1,7 +1,7 @@
FILE: main.kt
@R|Ann|(value = vararg(String(a), String(b))) public final fun test_1(): R|kotlin/Unit| {
}
- @R|Ann|(value = <implicitArrayOf>(String(a), String(b))) public final fun test_2(): R|kotlin/Unit| {
+ @R|Ann|(value = vararg(<implicitArrayOf>(String(a), String(b)))) public final fun test_2(): R|kotlin/Unit| {
}
@R|Ann|(value = vararg(*<implicitArrayOf>(String(a), String(b)))) public final fun test_3(): R|kotlin/Unit| {
}
diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.fir.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.fir.txt
index 5f96d3f..041eb39 100644
--- a/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.fir.txt
+++ b/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.fir.txt
@@ -9,9 +9,9 @@
R|/foo|(Int(1), vararg(String(my), String(yours)))
R|/foo|(Int(1), vararg(*R|kotlin/arrayOf|<R|kotlin/String|>(vararg(String(my), String(yours)))))
R|/foo<Inapplicable(INAPPLICABLE): /foo>#|(String())
- R|/foo<Inapplicable(INAPPLICABLE): /foo>#|(Int(1), Int(2))
+ R|/foo<Inapplicable(INAPPLICABLE): /foo>#|(Int(1), vararg(Int(2)))
R|/bar|(Int(1), Boolean(true), vararg(*R|kotlin/arrayOf|<R|kotlin/String|>(vararg(String(my), String(yours)))))
- R|/bar<Inapplicable(INAPPLICABLE): /bar>#|(Int(0), Boolean(false), *String(), String(other))
- R|/bar<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /bar>#|(Int(0), String(), Boolean(true))
- R|/bar<Inapplicable(INAPPLICABLE): /bar>#|(Int(0), Boolean(false), *String(), String(other), String(yet other))
+ R|/bar<Inapplicable(INAPPLICABLE): /bar>#|(Int(0), Boolean(false), String(other), vararg(*String()))
+ R|/bar<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /bar>#|(Int(0), vararg(String(), Boolean(true)))
+ R|/bar<Inapplicable(INAPPLICABLE): /bar>#|(Int(0), Boolean(false), String(other), String(yet other), vararg(*String()))
}
diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.fir.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.fir.txt
index 6e0af292..66ad2f6 100644
--- a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.fir.txt
+++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.fir.txt
@@ -37,5 +37,5 @@
R|/useEnum|(Q|TestEnum|.R|/TestEnum.SECOND|)
R|/useEnum|(Q|TestEnum|.R|/TestEnum.THIRD|)
R|/useVararg|(vararg(Q|TestEnum|.R|/TestEnum.FIRST|, Q|TestEnum|.R|/TestEnum.SECOND|))
- R|/useVararg<Inapplicable(INAPPLICABLE): /useVararg>#|(Int(1), Int(2), Int(3), Int(4), Int(5))
+ R|/useVararg<Inapplicable(INAPPLICABLE): /useVararg>#|(vararg(Int(1), Int(2), Int(3), Int(4), Int(5)))
}
diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirNamedVarargChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirNamedVarargChecker.kt
index 9137e23..8d0cb2f 100644
--- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirNamedVarargChecker.kt
+++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirNamedVarargChecker.kt
@@ -20,6 +20,7 @@
import org.jetbrains.kotlin.fir.languageVersionSettings
import org.jetbrains.kotlin.fir.references.FirErrorNamedReference
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
+import org.jetbrains.kotlin.fir.references.FirResolvedErrorReference
import org.jetbrains.kotlin.fir.types.*
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
@@ -43,7 +44,7 @@
fun checkArgument(argument: FirExpression, isVararg: Boolean, expectedArrayType: ConeKotlinType) {
if (!isNamedSpread(argument)) return
if (!argument.isFakeSpread && argument.isNamed) {
- if (isVararg && (expression as? FirResolvable)?.calleeReference !is FirErrorNamedReference) {
+ if (isVararg && (expression as? FirResolvable)?.calleeReference !is FirResolvedErrorReference) {
reporter.reportOn(argument.expression.source, redundantSpreadWarningFactory, context)
}
return
diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java
index 6020888..900a316 100644
--- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java
+++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java
@@ -24052,6 +24052,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGenerated.java
index 931220f..ee4e6c3 100644
--- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGenerated.java
+++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithFir2IrFakeOverrideGeneratorTestGenerated.java
@@ -24052,6 +24052,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java
index 32d1347..d003cc7 100644
--- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java
+++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java
@@ -24052,6 +24052,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
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 a5876c0..6e851e5 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
@@ -351,12 +351,11 @@
val originalArgumentList = result.argumentList
val subCandidate = calleeReference.candidate
val resultType = result.resolvedType.substituteType(subCandidate)
+ val allArgs = if (calleeReference.isError) originalArgumentList.arguments else subCandidate.argumentMapping?.keys?.toList().orEmpty()
+ val allArgsMapping = subCandidate.handleVarargsAndReturnAllArgsMapping(allArgs)
if (calleeReference.isError) {
- subCandidate.argumentMapping?.let {
- result.replaceArgumentList(buildArgumentListForErrorCall(originalArgumentList, it))
- }
+ result.replaceArgumentList(buildArgumentListForErrorCall(originalArgumentList, allArgsMapping))
} else {
- subCandidate.handleVarargs()
subCandidate.argumentMapping?.let {
val newArgumentList = buildResolvedArgumentList(originalArgumentList, it)
val symbol = subCandidate.symbol
@@ -485,12 +484,11 @@
}
}
}
+ val allArgs = if (calleeReference.isError) annotationCall.argumentList.arguments else subCandidate.argumentMapping?.keys?.toList().orEmpty()
+ val allArgsMapping = subCandidate.handleVarargsAndReturnAllArgsMapping(allArgs)
if (calleeReference.isError) {
- subCandidate.argumentMapping?.let {
- annotationCall.replaceArgumentList(buildArgumentListForErrorCall(annotationCall.argumentList, it))
- }
+ annotationCall.replaceArgumentList(buildArgumentListForErrorCall(annotationCall.argumentList, allArgsMapping))
} else {
- subCandidate.handleVarargs()
subCandidate.argumentMapping?.let {
annotationCall.replaceArgumentList(buildResolvedArgumentList(annotationCall.argumentList, it))
}
@@ -504,14 +502,27 @@
return transformAnnotationCall(errorAnnotationCall, data)
}
- private fun Candidate.handleVarargs() {
+ /**
+ * The function does two things:
+ * 1. Changes [Candidate.argumentMapping] if at least one vararg is presented.
+ * The new mapping wraps vararg arguments
+ * 2. Returns mapping of **all** args to parameters. Since args can be missing in the [Candidate.argumentMapping],
+ * the returned collection may contain `null`s. Generally speaking, it should only happen only in some cases when
+ * `calleeReference.isError` is `true` (see function usages)
+ */
+ private fun Candidate.handleVarargsAndReturnAllArgsMapping(argumentList: List<FirExpression>): LinkedHashMap<FirExpression, out FirValueParameter?> {
val argumentMapping = this.argumentMapping
val varargParameter = argumentMapping?.values?.firstOrNull { it.isVararg }
- if (varargParameter != null) {
+ return if (varargParameter != null) {
// Create a FirVarargArgumentExpression for the vararg arguments
val varargParameterTypeRef = varargParameter.returnTypeRef
val resolvedArrayType = varargParameterTypeRef.substitute(this)
- this.argumentMapping = remapArgumentsWithVararg(varargParameter, resolvedArrayType, argumentMapping)
+ val argumentMappingWithAllArgs =
+ remapArgumentsWithVararg(varargParameter, resolvedArrayType, argumentMapping, argumentList)
+ this.argumentMapping = argumentMappingWithAllArgs.filterValuesNotNull()
+ argumentMappingWithAllArgs
+ } else {
+ argumentList.associateWithTo(LinkedHashMap()) { argumentMapping?.get(it) }
}
}
@@ -700,12 +711,11 @@
val subCandidate = calleeReference.candidate
val originalArgumentList = delegatedConstructorCall.argumentList
+ val allArgs = if (calleeReference.isError) originalArgumentList.arguments else subCandidate.argumentMapping?.keys?.toList().orEmpty()
+ val allArgsMapping = subCandidate.handleVarargsAndReturnAllArgsMapping(allArgs)
if (calleeReference.isError) {
- subCandidate.argumentMapping?.let {
- delegatedConstructorCall.replaceArgumentList(buildArgumentListForErrorCall(originalArgumentList, it))
- }
+ delegatedConstructorCall.replaceArgumentList(buildArgumentListForErrorCall(originalArgumentList, allArgsMapping))
} else {
- subCandidate.handleVarargs()
subCandidate.argumentMapping?.let {
delegatedConstructorCall.replaceArgumentList(buildResolvedArgumentList(originalArgumentList, it))
}
@@ -1116,3 +1126,13 @@
internal fun FirQualifiedAccessExpression.addNonFatalDiagnostic(diagnostic: ConeDiagnostic) {
replaceNonFatalDiagnostics(nonFatalDiagnostics + listOf(diagnostic))
}
+
+private fun <K, V : Any> LinkedHashMap<out K, out V?>.filterValuesNotNull(): LinkedHashMap<K, V> {
+ val result = LinkedHashMap<K, V>()
+ for ((key, value) in this) {
+ if (value != null) {
+ result[key] = value
+ }
+ }
+ return result
+}
diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt
index 6613d05..8355710 100644
--- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt
+++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/BodyResolveUtils.kt
@@ -9,14 +9,10 @@
import org.jetbrains.kotlin.KtSourceElement
import org.jetbrains.kotlin.fakeElement
import org.jetbrains.kotlin.fir.FirSession
-import org.jetbrains.kotlin.fir.copyWithNewSource
import org.jetbrains.kotlin.fir.declarations.FirValueParameter
import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic
import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind
-import org.jetbrains.kotlin.fir.expressions.FirBlock
-import org.jetbrains.kotlin.fir.expressions.FirExpression
-import org.jetbrains.kotlin.fir.expressions.FirNamedArgumentExpression
-import org.jetbrains.kotlin.fir.expressions.UnresolvedExpressionTypeAccess
+import org.jetbrains.kotlin.fir.expressions.*
import org.jetbrains.kotlin.fir.expressions.builder.buildSpreadArgumentExpression
import org.jetbrains.kotlin.fir.expressions.builder.buildVarargArgumentsExpression
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
@@ -35,15 +31,15 @@
internal fun remapArgumentsWithVararg(
varargParameter: FirValueParameter,
varargArrayType: ConeKotlinType,
- argumentMapping: LinkedHashMap<FirExpression, FirValueParameter>
-): LinkedHashMap<FirExpression, FirValueParameter> {
+ argumentMapping: LinkedHashMap<FirExpression, FirValueParameter>,
+ argumentList: List<FirExpression>,
+): LinkedHashMap<FirExpression, FirValueParameter?> {
// Create a FirVarargArgumentExpression for the vararg arguments.
// The order of arguments in the mapping must be preserved for FIR2IR, hence we have to find where the vararg arguments end.
// FIR2IR uses the mapping order to determine if arguments need to be reordered.
val varargElementType = varargArrayType.arrayElementType()?.approximateIntegerLiteralType()
- val argumentList = argumentMapping.keys.toList()
var indexAfterVarargs = argumentList.size
- val newArgumentMapping = linkedMapOf<FirExpression, FirValueParameter>()
+ val newArgumentMapping = linkedMapOf<FirExpression, FirValueParameter?>()
val varargArgument = buildVarargArgumentsExpression {
coneElementTypeOrNull = varargElementType
coneTypeOrNull = varargArrayType
@@ -52,9 +48,10 @@
var firstVarargElementSource: KtSourceElement? = null
for ((i, arg) in argumentList.withIndex()) {
- val valueParameter = argumentMapping.getValue(arg)
- // Collect arguments if `arg` is a vararg argument of interest or other vararg arguments.
- if (valueParameter == varargParameter ||
+ val valueParameter = argumentMapping[arg]
+ if (valueParameter == null) {
+ newArgumentMapping[arg] = null
+ } else if (valueParameter == varargParameter ||
// NB: don't pull out of named arguments.
(valueParameter.isVararg && arg !is FirNamedArgumentExpression)
) {
@@ -88,7 +85,7 @@
// Add mapping for arguments after the vararg arguments, if any.
for (i in indexAfterVarargs until argumentList.size) {
val arg = argumentList[i]
- newArgumentMapping[arg] = argumentMapping.getValue(arg)
+ newArgumentMapping[arg] = argumentMapping[arg]
}
return newArgumentMapping
}
diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirArgumentUtil.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirArgumentUtil.kt
index 3d83094..0493f5c 100644
--- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirArgumentUtil.kt
+++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirArgumentUtil.kt
@@ -30,12 +30,9 @@
fun buildArgumentListForErrorCall(
original: FirArgumentList,
- mapping: LinkedHashMap<FirExpression, FirValueParameter>
+ mapping: LinkedHashMap<FirExpression, out FirValueParameter>,
): FirArgumentList {
- return FirResolvedArgumentListForErrorCall(
- original,
- original.arguments.associateWithTo(LinkedHashMap()) { key -> mapping[key] },
- )
+ return FirResolvedArgumentListForErrorCall(original, mapping)
}
object FirEmptyArgumentList : FirAbstractArgumentList() {
diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/impl/FirResolvedArgumentList.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/impl/FirResolvedArgumentList.kt
index 76df953..20ce0e3 100644
--- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/impl/FirResolvedArgumentList.kt
+++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/impl/FirResolvedArgumentList.kt
@@ -60,7 +60,7 @@
internal class FirResolvedArgumentListForErrorCall(
override val originalArgumentList: FirArgumentList?,
- private var _mapping: LinkedHashMap<FirExpression, FirValueParameter?>,
+ private var _mapping: LinkedHashMap<FirExpression, out FirValueParameter?>,
) : FirResolvedArgumentList() {
override var mapping: LinkedHashMap<FirExpression, FirValueParameter> = computeMapping()
diff --git a/compiler/testData/codegen/box/inference/kt67609.kt b/compiler/testData/codegen/box/inference/kt67609.kt
new file mode 100644
index 0000000..0724bb1
--- /dev/null
+++ b/compiler/testData/codegen/box/inference/kt67609.kt
@@ -0,0 +1,16 @@
+// IGNORE_BACKEND_K1: ANY
+// Ignore Wasm and Native because they fail at runtime KT-67691
+// IGNORE_BACKEND_K2: WASM, NATIVE
+class In<in K>
+
+fun <E> intersect(vararg x: In<E>): E = null as E
+
+fun box(): String {
+ val a = intersect(In<Int>(), In<String>()) // K2: INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING
+ val b = intersect(In<Int>(), *arrayOf(In<String>())) // K2: INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING
+ val c = intersect(x = arrayOf(In<Int>(), In<String>())) // K1: TYPE_MISMATCH error. K2: INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING
+ val d = intersect(x = *arrayOf(In<Int>(), In<String>())) // K1: TYPE_MISMATCH error. K2: INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING
+ val e = intersect(In<Int>(), *arrayOf(In<String>()), In<Long>()) // K2: INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING
+ val f = intersect(*arrayOf(In<Int>()), In<String>(), *arrayOf(In<Long>())) // K2: INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING
+ return if (a == null && a == b && b == c && c == d && d == e && e == f) "OK" else "NOT_OK"
+}
diff --git a/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.fir.kt b/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.fir.kt
index ced8e27..2d2971c 100644
--- a/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.fir.kt
+++ b/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.fir.kt
@@ -43,10 +43,10 @@
joinG(1, "2")
joinG(<!NON_VARARG_SPREAD!>*<!>1, "2")
- <!CANNOT_INFER_PARAMETER_TYPE!>joinG<!>(1, *<!ARGUMENT_TYPE_MISMATCH!>"2"<!>)
+ <!CANNOT_INFER_PARAMETER_TYPE!>joinG<!>(1, <!CANNOT_INFER_PARAMETER_TYPE!>*<!ARGUMENT_TYPE_MISMATCH!>"2"<!><!>)
joinG(x = 1, a = a)
- <!CANNOT_INFER_PARAMETER_TYPE!>joinG<!>(x = 1, a = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>"2"<!>)
- <!CANNOT_INFER_PARAMETER_TYPE!>joinG<!>(x = <!NON_VARARG_SPREAD!>*<!>1, a = *<!ARGUMENT_TYPE_MISMATCH!>"2"<!>)
+ <!CANNOT_INFER_PARAMETER_TYPE!>joinG<!>(x = 1, <!CANNOT_INFER_PARAMETER_TYPE!>a = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>"2"<!><!>)
+ <!CANNOT_INFER_PARAMETER_TYPE!>joinG<!>(x = <!NON_VARARG_SPREAD!>*<!>1, <!CANNOT_INFER_PARAMETER_TYPE!>a = *<!ARGUMENT_TYPE_MISMATCH!>"2"<!><!>)
joinG(1, *a)
joinG(1, *a, "3")
joinG(1, "4", *a, "3")
diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.fir.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.fir.kt
index 4ebc534..a347e6a 100644
--- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.fir.kt
+++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.fir.kt
@@ -1,10 +1,16 @@
package f
+class In<in K>
+
fun <T> f(i: Int, c: Collection<T>): List<T> {throw Exception()}
fun <T> f(a: Any, l: List<T>): Collection<T> {throw Exception()}
+fun <T, K> g(i: Int, c: Collection<T>, vararg x: In<K>): List<T> {throw Exception()}
+fun <T, K> g(a: Any, l: List<T>, vararg x: In<K>): Collection<T> {throw Exception()}
+
fun <T> test(l: List<T>) {
<!OVERLOAD_RESOLUTION_AMBIGUITY!>f<!>(1, <!CANNOT_INFER_PARAMETER_TYPE!>emptyList<!>())
+ <!NONE_APPLICABLE!>g<!>(1, <!CANNOT_INFER_PARAMETER_TYPE!>emptyList<!>(), In<String>(), In<Int>())
}
fun <T> emptyList(): List<T> {throw Exception()}
diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.kt
index c2116e2..bc464da 100644
--- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.kt
+++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.kt
@@ -1,10 +1,16 @@
package f
+class In<in K>
+
fun <T> f(i: Int, c: Collection<T>): List<T> {throw Exception()}
fun <T> f(a: Any, l: List<T>): Collection<T> {throw Exception()}
+fun <T, K> g(i: Int, c: Collection<T>, vararg x: In<K>): List<T> {throw Exception()}
+fun <T, K> g(a: Any, l: List<T>, vararg x: In<K>): Collection<T> {throw Exception()}
+
fun <T> test(l: List<T>) {
<!OVERLOAD_RESOLUTION_AMBIGUITY!>f<!>(1, emptyList())
+ <!OVERLOAD_RESOLUTION_AMBIGUITY!>g<!>(1, emptyList(), In<String>(), In<Int>())
}
fun <T> emptyList(): List<T> {throw Exception()}
diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.txt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.txt
index be2615c..83f36a9 100644
--- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.txt
+++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.txt
@@ -4,5 +4,14 @@
public fun </*0*/ T> emptyList(): kotlin.collections.List<T>
public fun </*0*/ T> f(/*0*/ a: kotlin.Any, /*1*/ l: kotlin.collections.List<T>): kotlin.collections.Collection<T>
public fun </*0*/ T> f(/*0*/ i: kotlin.Int, /*1*/ c: kotlin.collections.Collection<T>): kotlin.collections.List<T>
+ public fun </*0*/ T, /*1*/ K> g(/*0*/ a: kotlin.Any, /*1*/ l: kotlin.collections.List<T>, /*2*/ vararg x: f.In<K> /*kotlin.Array<out f.In<K>>*/): kotlin.collections.Collection<T>
+ public fun </*0*/ T, /*1*/ K> g(/*0*/ i: kotlin.Int, /*1*/ c: kotlin.collections.Collection<T>, /*2*/ vararg x: f.In<K> /*kotlin.Array<out f.In<K>>*/): kotlin.collections.List<T>
public fun </*0*/ T> test(/*0*/ l: kotlin.collections.List<T>): kotlin.Unit
+
+ public final class In</*0*/ in K> {
+ public constructor In</*0*/ in K>()
+ public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
+ public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
+ public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
+ }
}
diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.fir.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.fir.kt
new file mode 100644
index 0000000..7764ac4
--- /dev/null
+++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.fir.kt
@@ -0,0 +1,17 @@
+// !DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS
+package f
+
+class In<in K>
+
+fun <R> h(f: (Boolean) -> R) = 1
+fun <R> h(f: (String) -> R) = 2
+
+fun <R, K> f(f: (Boolean) -> R, vararg x: In<K>) = 1
+fun <R, K> f(f: (String) -> R, vararg x: In<K>) = 2
+
+fun test() {
+ <!OVERLOAD_RESOLUTION_AMBIGUITY!>h<!>{ <!CANNOT_INFER_PARAMETER_TYPE!>i<!> -> getAnswer() }
+ <!NONE_APPLICABLE!>f<!>({ <!CANNOT_INFER_PARAMETER_TYPE!>i<!> -> getAnswer() }, In<String>(), In<Int>())
+}
+
+fun getAnswer() = 42
diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.kt
index 4e88bd4..74f6d87 100644
--- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.kt
+++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.kt
@@ -1,10 +1,17 @@
-// FIR_IDENTICAL
// !DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS
package f
+class In<in K>
+
fun <R> h(f: (Boolean) -> R) = 1
fun <R> h(f: (String) -> R) = 2
-fun test() = <!OVERLOAD_RESOLUTION_AMBIGUITY!>h<!>{ <!CANNOT_INFER_PARAMETER_TYPE!>i<!> -> getAnswer() }
+fun <R, K> f(f: (Boolean) -> R, vararg x: In<K>) = 1
+fun <R, K> f(f: (String) -> R, vararg x: In<K>) = 2
+
+fun test() {
+ <!OVERLOAD_RESOLUTION_AMBIGUITY!>h<!>{ <!CANNOT_INFER_PARAMETER_TYPE!>i<!> -> getAnswer() }
+ <!OVERLOAD_RESOLUTION_AMBIGUITY!>f<!>({ <!CANNOT_INFER_PARAMETER_TYPE!>i<!> -> getAnswer() }, In<String>(), In<Int>())
+}
fun getAnswer() = 42
diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.txt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.txt
index 46354c6..73c9063 100644
--- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.txt
+++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.txt
@@ -1,8 +1,17 @@
package
package f {
+ public fun </*0*/ R, /*1*/ K> f(/*0*/ f: (kotlin.Boolean) -> R, /*1*/ vararg x: f.In<K> /*kotlin.Array<out f.In<K>>*/): kotlin.Int
+ public fun </*0*/ R, /*1*/ K> f(/*0*/ f: (kotlin.String) -> R, /*1*/ vararg x: f.In<K> /*kotlin.Array<out f.In<K>>*/): kotlin.Int
public fun getAnswer(): kotlin.Int
public fun </*0*/ R> h(/*0*/ f: (kotlin.Boolean) -> R): kotlin.Int
public fun </*0*/ R> h(/*0*/ f: (kotlin.String) -> R): kotlin.Int
- public fun test(): [Error type: Return type for function cannot be resolved]
+ public fun test(): kotlin.Unit
+
+ public final class In</*0*/ in K> {
+ public constructor In</*0*/ in K>()
+ public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
+ public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
+ public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
+ }
}
diff --git a/compiler/testData/diagnostics/tests/inference/kt46515.fir.kt b/compiler/testData/diagnostics/tests/inference/kt46515.fir.kt
index ea9ef47..ede45ea 100644
--- a/compiler/testData/diagnostics/tests/inference/kt46515.fir.kt
+++ b/compiler/testData/diagnostics/tests/inference/kt46515.fir.kt
@@ -1,5 +1,9 @@
// WITH_STDLIB
+class In<in K>()
+fun <T, R : Comparable<R>, K> Iterable<T>.maxOf(selector: (T) -> R, vararg x: In<K>) {}
+
fun bar() {
listOf(1, 2, 3).<!NONE_APPLICABLE!>maxOf<!> <!UNRESOLVED_REFERENCE!>{ <!UNRESOLVED_REFERENCE!>foo<!> }<!>
+ listOf(1, 2, 3).<!CANNOT_INFER_PARAMETER_TYPE, INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>maxOf<!>(<!UNRESOLVED_REFERENCE!>{ <!UNRESOLVED_REFERENCE!>foo<!> }<!>, In<String>(), In<Int>())
}
\ No newline at end of file
diff --git a/compiler/testData/diagnostics/tests/inference/kt46515.kt b/compiler/testData/diagnostics/tests/inference/kt46515.kt
index 218a0ec..aff5533 100644
--- a/compiler/testData/diagnostics/tests/inference/kt46515.kt
+++ b/compiler/testData/diagnostics/tests/inference/kt46515.kt
@@ -1,5 +1,9 @@
// WITH_STDLIB
+class In<in K>()
+fun <T, R : Comparable<R>, K> Iterable<T>.maxOf(selector: (T) -> R, vararg x: In<K>) {}
+
fun bar() {
listOf(1, 2, 3).<!NONE_APPLICABLE!>maxOf<!> { <!UNRESOLVED_REFERENCE!>foo<!> }
+ listOf(1, 2, 3).<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING!>maxOf<!>(<!TYPE_MISMATCH, TYPE_MISMATCH!>{ <!UNRESOLVED_REFERENCE!>foo<!> }<!>, In<String>(), In<Int>())
}
\ No newline at end of file
diff --git a/compiler/testData/diagnostics/tests/inference/kt46515.txt b/compiler/testData/diagnostics/tests/inference/kt46515.txt
index 19a5b88..d2ae495 100644
--- a/compiler/testData/diagnostics/tests/inference/kt46515.txt
+++ b/compiler/testData/diagnostics/tests/inference/kt46515.txt
@@ -1,3 +1,12 @@
package
public fun bar(): kotlin.Unit
+public fun </*0*/ T, /*1*/ R : kotlin.Comparable<R>, /*2*/ K> kotlin.collections.Iterable<T>.maxOf(/*0*/ selector: (T) -> R, /*1*/ vararg x: In<K> /*kotlin.Array<out In<K>>*/): kotlin.Unit
+
+public final class In</*0*/ in K> {
+ public constructor In</*0*/ in K>()
+ public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
+ public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
+ public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
+}
+
diff --git a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.fir.kt b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.fir.kt
index 589eec8..ca566d9 100644
--- a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.fir.kt
+++ b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.fir.kt
@@ -39,7 +39,7 @@
genFoo<Array<Int>>(t = <!ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>arrayOf()<!>)
genFoo<Array<Int>>(t = *<!REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_FUNCTION!>arrayOf(arrayOf())<!>)
- <!CANNOT_INFER_PARAMETER_TYPE!>genFoo<!>(t = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>""<!>)
+ <!CANNOT_INFER_PARAMETER_TYPE!>genFoo<!>(<!CANNOT_INFER_PARAMETER_TYPE!>t = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>""<!><!>)
genFoo(t = <!ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_ERROR!>arrayOf("")<!>)
genFoo(t = *<!REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_FUNCTION!>arrayOf("")<!>)
}
diff --git a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.fir.kt b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.fir.kt
index 967314f..338b89b 100644
--- a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.fir.kt
+++ b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.fir.kt
@@ -39,7 +39,7 @@
genFoo<Array<Int>>(t = <!ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_WARNING!>arrayOf()<!>)
genFoo<Array<Int>>(t = *<!REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_FUNCTION!>arrayOf(arrayOf())<!>)
- <!CANNOT_INFER_PARAMETER_TYPE!>genFoo<!>(t = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_WARNING!>""<!>)
+ <!CANNOT_INFER_PARAMETER_TYPE!>genFoo<!>(<!CANNOT_INFER_PARAMETER_TYPE!>t = <!ARGUMENT_TYPE_MISMATCH, ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_WARNING!>""<!><!>)
genFoo(t = <!ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION_WARNING!>arrayOf("")<!>)
genFoo(t = *<!REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_FUNCTION!>arrayOf("")<!>)
}
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java
index 4ea1615..47d80a2 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/JvmAbiConsistencyTestBoxGenerated.java
@@ -24052,6 +24052,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java
index a2929fe..a71f1e3 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java
@@ -22780,6 +22780,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java
index a5ef429..09d45fc 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java
@@ -24052,6 +24052,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java
index 651a028..78283c8 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java
@@ -24052,6 +24052,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java
index 43a0d18..c24fefa 100644
--- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java
+++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/inlineScopes/FirBlackBoxCodegenTestWithInlineScopesGenerated.java
@@ -24052,6 +24052,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java
index 438670d..4efa29c 100644
--- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java
+++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java
@@ -20141,6 +20141,11 @@
runTest("compiler/testData/codegen/box/inference/kt65882.kt");
}
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java
index 2c4b621..edd9901 100644
--- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java
+++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java
@@ -18244,6 +18244,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java
index be24afd..9743266 100644
--- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java
+++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java
@@ -18244,6 +18244,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java
index 3e88a09..18d0eba 100644
--- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java
+++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java
@@ -18244,6 +18244,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java
index 4352f3a..8f5e0dc 100644
--- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java
+++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java
@@ -18244,6 +18244,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java
index c106811..cfafea8 100644
--- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java
+++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java
@@ -19533,6 +19533,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java
index 3136855..22990ed 100644
--- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java
+++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java
@@ -19955,6 +19955,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java
index 06b3071..384b89f 100644
--- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java
+++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java
@@ -19111,6 +19111,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java
index a37a6f6..60291f8 100644
--- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java
+++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java
@@ -19534,6 +19534,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java
index 76aec29..3f10b46 100644
--- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java
+++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmJsCodegenBoxTestGenerated.java
@@ -18286,6 +18286,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");
diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java
index 10ce225..ead2899 100644
--- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java
+++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java
@@ -18286,6 +18286,12 @@
}
@Test
+ @TestMetadata("kt67609.kt")
+ public void testKt67609() {
+ runTest("compiler/testData/codegen/box/inference/kt67609.kt");
+ }
+
+ @Test
@TestMetadata("lambdaWithStarReturn.kt")
public void testLambdaWithStarReturn() {
runTest("compiler/testData/codegen/box/inference/lambdaWithStarReturn.kt");