diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt index 364008d5e2b..28c819ac230 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/inference/CoroutineInferenceSession.kt @@ -19,18 +19,12 @@ import org.jetbrains.kotlin.resolve.calls.context.BasicCallResolutionContext import org.jetbrains.kotlin.resolve.calls.inference.components.KotlinConstraintSystemCompleter import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutor import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutorByConstructorMap -import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintKind -import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage -import org.jetbrains.kotlin.resolve.calls.inference.model.NewConstraintSystemImpl -import org.jetbrains.kotlin.resolve.calls.inference.model.NewTypeVariable +import org.jetbrains.kotlin.resolve.calls.inference.model.* import org.jetbrains.kotlin.resolve.calls.model.* import org.jetbrains.kotlin.resolve.calls.tower.* import org.jetbrains.kotlin.resolve.calls.util.FakeCallableDescriptorForObject import org.jetbrains.kotlin.resolve.deprecation.DeprecationResolver -import org.jetbrains.kotlin.types.StubType -import org.jetbrains.kotlin.types.TypeApproximator -import org.jetbrains.kotlin.types.TypeConstructor -import org.jetbrains.kotlin.types.UnwrappedType +import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.expressions.DoubleColonExpressionResolver import org.jetbrains.kotlin.types.expressions.ExpressionTypingServices import org.jetbrains.kotlin.utils.addToStdlib.cast @@ -58,7 +52,20 @@ class CoroutineInferenceSession( private val commonCalls = arrayListOf() private val diagnostics = arrayListOf() - override fun shouldRunCompletion(candidate: KotlinResolutionCandidate): Boolean = true + override fun shouldRunCompletion(candidate: KotlinResolutionCandidate): Boolean { + val system = candidate.getSystem() as NewConstraintSystemImpl + val storage = system.getBuilder().currentStorage() + fun ResolvedAtom.hasPostponed(): Boolean { + if (this is PostponedResolvedAtom && !analyzed) return true + return subResolvedAtoms?.any { it.hasPostponed() } == true + } + + return !storage.notFixedTypeVariables.keys.any { + val variable = storage.allTypeVariables[it] + val isPostponed = variable != null && variable in storage.postponedTypeVariables + !isPostponed && !kotlinConstraintSystemCompleter.variableFixationFinder.isTypeVariableHasProperConstraint(system, it) + } || candidate.getSubResolvedAtoms().any { it.hasPostponed() } + } override fun addCompletedCallInfo(callInfo: CompletedCallInfo) { require(callInfo is PSICompletedCallInfo) { "Wrong instance of callInfo: $callInfo" } @@ -100,7 +107,11 @@ class CoroutineInferenceSession( val commonSystem = buildCommonSystem(initialStorage) val context = commonSystem.asConstraintSystemCompleterContext() - kotlinConstraintSystemCompleter.completeConstraintSystem(context, builtIns.unitType) + kotlinConstraintSystemCompleter.completeConstraintSystem( + context, + builtIns.unitType, + partiallyResolvedCallsInfo.map { it.callResolutionResult.resultCallAtom } + ) updateCalls(lambda, commonSystem) @@ -132,7 +143,7 @@ class CoroutineInferenceSession( * * while substitutor from parameter map non-fixed types to the original type variable * */ - val callSubstitutor = storage.buildResultingSubstitutor(commonSystem) // substitutor only for fixed variables + val callSubstitutor = storage.buildResultingSubstitutor(commonSystem, transformTypeVariablesToErrorTypes = false) for (initialConstraint in storage.initialConstraints) { val lower = nonFixedToVariablesSubstitutor.safeSubstitute(callSubstitutor.safeSubstitute(initialConstraint.a as UnwrappedType)) // TODO: SUB @@ -164,6 +175,9 @@ class CoroutineInferenceSession( for (call in commonCalls) { integrateConstraints(commonSystem, call.callResolutionResult.constraintSystem, nonFixedToVariablesSubstitutor) } + for (call in partiallyResolvedCallsInfo) { + integrateConstraints(commonSystem, call.callResolutionResult.constraintSystem, nonFixedToVariablesSubstitutor) + } for (diagnostic in diagnostics) { commonSystem.addError(diagnostic) } @@ -192,6 +206,16 @@ class CoroutineInferenceSession( } val lambdaAtomCompleter = createResolvedAtomCompleter(nonFixedTypesToResultSubstitutor, topLevelCallContext) + for (callInfo in partiallyResolvedCallsInfo) { + val resolvedCall = completeCall(callInfo, lambdaAtomCompleter) ?: continue + kotlinToResolvedCallTransformer.reportCallDiagnostic( + callInfo.context, + trace, + callInfo.callResolutionResult.resultCallAtom, + resolvedCall.resultingDescriptor, + commonSystem.diagnostics + ) + } lambdaAtomCompleter.completeAll(lambda) } @@ -203,20 +227,29 @@ class CoroutineInferenceSession( val resultingCallSubstitutor = completedCall.callResolutionResult.constraintSystem.fixedTypeVariables.entries .associate { it.key to nonFixedTypesToResultSubstitutor.safeSubstitute(it.value as UnwrappedType) } // TODO: SUB - val resultingSubstitutor = NewTypeSubstitutorByConstructorMap((resultingCallSubstitutor + nonFixedTypesToResult).cast()) // TODO: SUB + val resultingSubstitutor = + NewTypeSubstitutorByConstructorMap((resultingCallSubstitutor + nonFixedTypesToResult).cast()) // TODO: SUB val atomCompleter = createResolvedAtomCompleter(resultingSubstitutor, completedCall.context) - val resultCallAtom = completedCall.callResolutionResult.resultCallAtom + completeCall(completedCall, atomCompleter) + } + + private fun completeCall( + callInfo: CallInfo, + atomCompleter: ResolvedAtomCompleter + ): ResolvedCall<*>? { + val resultCallAtom = callInfo.callResolutionResult.resultCallAtom resultCallAtom.subResolvedAtoms?.forEach { subResolvedAtom -> atomCompleter.completeAll(subResolvedAtom) } - atomCompleter.completeResolvedCall(resultCallAtom, completedCall.callResolutionResult.diagnostics) + val resolvedCall = atomCompleter.completeResolvedCall(resultCallAtom, callInfo.callResolutionResult.diagnostics) - val callTrace = completedCall.context.trace + val callTrace = callInfo.context.trace if (callTrace is TemporaryBindingTrace) { callTrace.commit() } + return resolvedCall } private fun createResolvedAtomCompleter( diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt index 9cb3fb6bda5..8b4d58744a0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ManyCandidatesResolver.kt @@ -26,7 +26,7 @@ abstract class ManyCandidatesResolver( protected val callComponents: KotlinCallComponents, val builtIns: KotlinBuiltIns ) : InferenceSession { - private val partiallyResolvedCallsInfo = arrayListOf() + protected val partiallyResolvedCallsInfo = arrayListOf() private val errorCallsInfo = arrayListOf>() private val completedCalls = hashSetOf() @@ -170,18 +170,24 @@ data class ResolutionResultCallInfo( val overloadResolutionResults: OverloadResolutionResults ) -class PSIPartialCallInfo( - override val callResolutionResult: PartialCallResolutionResult, +abstract class CallInfo( + open val callResolutionResult: SingleCallResolutionResult, val context: BasicCallResolutionContext, val tracingStrategy: TracingStrategy -) : PartialCallInfo +) + +class PSIPartialCallInfo( + override val callResolutionResult: PartialCallResolutionResult, + context: BasicCallResolutionContext, + tracingStrategy: TracingStrategy +) : CallInfo(callResolutionResult, context, tracingStrategy), PartialCallInfo class PSICompletedCallInfo( override val callResolutionResult: CompletedCallResolutionResult, - val context: BasicCallResolutionContext, + context: BasicCallResolutionContext, val resolvedCall: ResolvedCall<*>, - val tracingStrategy: TracingStrategy -) : CompletedCallInfo + tracingStrategy: TracingStrategy +) : CallInfo(callResolutionResult, context, tracingStrategy), CompletedCallInfo class PSIErrorCallInfo( override val callResolutionResult: CallResolutionResult, diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/InferenceUtils.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/InferenceUtils.kt index 67a6625565d..3eb46710ce5 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/InferenceUtils.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/InferenceUtils.kt @@ -30,20 +30,25 @@ fun ConstraintStorage.buildCurrentSubstitutor( return context.typeSubstitutorByTypeConstructor(fixedTypeVariables.entries.associate { it.key to it.value } + additionalBindings) } -fun ConstraintStorage.buildAbstractResultingSubstitutor(context: TypeSystemInferenceExtensionContext): TypeSubstitutorMarker = +fun ConstraintStorage.buildAbstractResultingSubstitutor(context: TypeSystemInferenceExtensionContext, transformTypeVariablesToErrorTypes: Boolean = true): TypeSubstitutorMarker = with(context) { if (allTypeVariables.isEmpty()) return createEmptySubstitutor() val currentSubstitutorMap = fixedTypeVariables.entries.associate { it.key to it.value } - val uninferredSubstitutorMap = notFixedTypeVariables.entries.associate { (freshTypeConstructor, typeVariable) -> - freshTypeConstructor to context.createErrorTypeWithCustomConstructor( - "Uninferred type", - (typeVariable.typeVariable).freshTypeConstructor() - ) + val uninferredSubstitutorMap = if (transformTypeVariablesToErrorTypes) { + notFixedTypeVariables.entries.associate { (freshTypeConstructor, typeVariable) -> + freshTypeConstructor to context.createErrorTypeWithCustomConstructor( + "Uninferred type", + (typeVariable.typeVariable).freshTypeConstructor() + ) + } + } else { + notFixedTypeVariables.entries.associate { (freshTypeConstructor, typeVariable) -> + freshTypeConstructor to typeVariable.typeVariable.defaultType(this) + } } - return context.typeSubstitutorByTypeConstructor(currentSubstitutorMap + uninferredSubstitutorMap) } @@ -52,8 +57,8 @@ fun ConstraintStorage.buildNotFixedVariablesToNonSubtypableTypesSubstitutor(cont notFixedTypeVariables.mapValues { context.createStubType(it.value.typeVariable) } ) -fun ConstraintStorage.buildResultingSubstitutor(context: TypeSystemInferenceExtensionContext): NewTypeSubstitutor { - return buildAbstractResultingSubstitutor(context) as NewTypeSubstitutor +fun ConstraintStorage.buildResultingSubstitutor(context: TypeSystemInferenceExtensionContext, transformTypeVariablesToErrorTypes: Boolean = true): NewTypeSubstitutor { + return buildAbstractResultingSubstitutor(context, transformTypeVariablesToErrorTypes) as NewTypeSubstitutor } val CallableDescriptor.returnTypeOrNothing: UnwrappedType diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt index 0ae7930859b..b376615e772 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/KotlinConstraintSystemCompleter.kt @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs class KotlinConstraintSystemCompleter( private val resultTypeResolver: ResultTypeResolver, - private val variableFixationFinder: VariableFixationFinder, + val variableFixationFinder: VariableFixationFinder, private val statelessCallbacks: KotlinResolutionStatelessCallbacks ) { enum class ConstraintSystemCompletionMode { @@ -55,8 +55,8 @@ class KotlinConstraintSystemCompleter( runCompletion(c, completionMode, topLevelAtoms, topLevelType, collectVariablesFromContext = false, analyze = analyze) } - fun completeConstraintSystem(c: Context, topLevelType: UnwrappedType) { - runCompletion(c, ConstraintSystemCompletionMode.FULL, emptyList(), topLevelType, collectVariablesFromContext = true) { + fun completeConstraintSystem(c: Context, topLevelType: UnwrappedType, topLevelAtoms: List) { + runCompletion(c, ConstraintSystemCompletionMode.FULL, topLevelAtoms, topLevelType, collectVariablesFromContext = true) { error("Shouldn't be called in complete constraint system mode") } } diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/VariableFixationFinder.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/VariableFixationFinder.kt index 25e6fdb91d4..a90550d8a01 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/VariableFixationFinder.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/VariableFixationFinder.kt @@ -50,7 +50,7 @@ class VariableFixationFinder( topLevelType: KotlinTypeMarker ): VariableForFixation? = c.findTypeVariableForFixation(allTypeVariables, postponedKtPrimitives, completionMode, topLevelType) - private enum class TypeVariableFixationReadiness { + enum class TypeVariableFixationReadiness { FORBIDDEN, WITHOUT_PROPER_ARGUMENT_CONSTRAINT, // proper constraint from arguments -- not from upper bound for type parameters WITH_COMPLEX_DEPENDENCY, // if type variable T has constraint with non fixed type variable inside (non-top-level): T <: Foo @@ -74,6 +74,18 @@ class VariableFixationFinder( else -> TypeVariableFixationReadiness.READY_FOR_FIXATION } + fun isTypeVariableHasProperConstraint(context: Context, typeVariable: TypeConstructorMarker): Boolean { + return with(context) { + val dependencyProvider = TypeVariableDependencyInformationProvider( + notFixedTypeVariables, emptyList(), topLevelType = null, context + ) + when (getTypeVariableReadiness(typeVariable, dependencyProvider)) { + TypeVariableFixationReadiness.FORBIDDEN, TypeVariableFixationReadiness.WITHOUT_PROPER_ARGUMENT_CONSTRAINT -> false + else -> true + } + } + } + private fun Context.findTypeVariableForFixation( allTypeVariables: List, postponedArguments: List, diff --git a/compiler/testData/codegen/box/inference/kt35684.kt b/compiler/testData/codegen/box/inference/kt35684.kt new file mode 100644 index 00000000000..a30d1b8c0c8 --- /dev/null +++ b/compiler/testData/codegen/box/inference/kt35684.kt @@ -0,0 +1,26 @@ +// !LANGUAGE: +NewInference +// !USE_EXPERIMENTAL: kotlin.Experimental +// IGNORE_BACKEND_FIR: JVM_IR +// WITH_RUNTIME + +// ISSUE: KT-35684 + +import kotlin.experimental.ExperimentalTypeInference + +fun test() { + sequence { + yield(materialize()) + yield(materialize()) + } +} + +@UseExperimental(ExperimentalTypeInference::class) +fun sequence(@BuilderInference block: suspend Inv.() -> Unit) {} + +interface Inv { + fun yield(element: T) +} + +fun materialize(): Inv = TODO() + +fun box(): String = "OK" \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt new file mode 100644 index 00000000000..1112e2c8198 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt @@ -0,0 +1,35 @@ +// !LANGUAGE: +NewInference +// !USE_EXPERIMENTAL: kotlin.Experimental +// !DIAGNOSTICS: -UNUSED_PARAMETER +// ISSUE: KT-35684 + +import kotlin.experimental.ExperimentalTypeInference + +fun test_1() { + ")!>sequence { + yield(")!>materialize()) + yield(materialize()) + } +} + +fun test_2() { + sequence { + yield(materialize()) + } +} + +fun test_3() { + sequence { + yield(materialize()) + materialize() + } +} + +@UseExperimental(ExperimentalTypeInference::class) +fun sequence(@BuilderInference block: suspend Inv.() -> Unit): U = null!! + +interface Inv { + fun yield(element: T) +} + +fun materialize(): Inv = TODO() \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.txt new file mode 100644 index 00000000000..4e04f9cd5b6 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.txt @@ -0,0 +1,14 @@ +package + +public fun materialize(): Inv +@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun sequence(/*0*/ @kotlin.BuilderInference block: suspend Inv.() -> kotlin.Unit): U +public fun test_1(): kotlin.Unit +public fun test_2(): kotlin.Unit +public fun test_3(): kotlin.Unit + +public interface Inv { + 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 + public abstract fun yield(/*0*/ element: T): kotlin.Unit +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java index aa669f7a384..bb45abb3acf 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java @@ -1952,6 +1952,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32271.kt"); } + @TestMetadata("kt35684.kt") + public void testKt35684() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt"); + } + @TestMetadata("nestedLambdaInferenceWithListMap.kt") public void testNestedLambdaInferenceWithListMap() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedLambdaInferenceWithListMap.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java index ece3508fa9e..a26d6710092 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java @@ -1952,6 +1952,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt32271.kt"); } + @TestMetadata("kt35684.kt") + public void testKt35684() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/kt35684.kt"); + } + @TestMetadata("nestedLambdaInferenceWithListMap.kt") public void testNestedLambdaInferenceWithListMap() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/nestedLambdaInferenceWithListMap.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 84b7ee95d74..2ef5c00e70d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -12591,6 +12591,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/inference/kt32429.kt"); } + @TestMetadata("kt35684.kt") + public void testKt35684() throws Exception { + runTest("compiler/testData/codegen/box/inference/kt35684.kt"); + } + @TestMetadata("lastExpressionOfLambdaWithNothingConstraint.kt") public void testLastExpressionOfLambdaWithNothingConstraint() throws Exception { runTest("compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index b4e7cd00a41..1c64326cec7 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -12591,6 +12591,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/inference/kt32429.kt"); } + @TestMetadata("kt35684.kt") + public void testKt35684() throws Exception { + runTest("compiler/testData/codegen/box/inference/kt35684.kt"); + } + @TestMetadata("lastExpressionOfLambdaWithNothingConstraint.kt") public void testLastExpressionOfLambdaWithNothingConstraint() throws Exception { runTest("compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 5dc321ffa68..c1eba7cc0e9 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -11441,6 +11441,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/inference/kt32429.kt"); } + @TestMetadata("kt35684.kt") + public void testKt35684() throws Exception { + runTest("compiler/testData/codegen/box/inference/kt35684.kt"); + } + @TestMetadata("lastExpressionOfLambdaWithNothingConstraint.kt") public void testLastExpressionOfLambdaWithNothingConstraint() throws Exception { runTest("compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index d73d33d3b02..4a3e50f9754 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -11441,6 +11441,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/inference/kt32429.kt"); } + @TestMetadata("kt35684.kt") + public void testKt35684() throws Exception { + runTest("compiler/testData/codegen/box/inference/kt35684.kt"); + } + @TestMetadata("lastExpressionOfLambdaWithNothingConstraint.kt") public void testLastExpressionOfLambdaWithNothingConstraint() throws Exception { runTest("compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 278da75c2de..a64cb5a4ab3 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -9846,6 +9846,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inference/kt10822.kt"); } + @TestMetadata("kt35684.kt") + public void testKt35684() throws Exception { + runTest("compiler/testData/codegen/box/inference/kt35684.kt"); + } + @TestMetadata("lastExpressionOfLambdaWithNothingConstraint.kt") public void testLastExpressionOfLambdaWithNothingConstraint() throws Exception { runTest("compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 9e842ddb6c6..c039679f486 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -10986,6 +10986,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/inference/kt10822.kt"); } + @TestMetadata("kt35684.kt") + public void testKt35684() throws Exception { + runTest("compiler/testData/codegen/box/inference/kt35684.kt"); + } + @TestMetadata("lastExpressionOfLambdaWithNothingConstraint.kt") public void testLastExpressionOfLambdaWithNothingConstraint() throws Exception { runTest("compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt");