From f4004fb06a3a06acf22637f0649ddbc1748c3441 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Tue, 8 Aug 2023 14:02:21 +0200 Subject: [PATCH] Add kdoc for ConstraintSystemCompletionMode.PARTIAL --- .../components/ConstraintSystemCompletionMode.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/components/ConstraintSystemCompletionMode.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/components/ConstraintSystemCompletionMode.kt index 444d1a22008..679c171f8ac 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/components/ConstraintSystemCompletionMode.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/components/ConstraintSystemCompletionMode.kt @@ -7,6 +7,17 @@ package org.jetbrains.kotlin.resolve.calls.inference.components enum class ConstraintSystemCompletionMode { FULL, + + /** + * This mode allows us to infer variables in calls, which have enough type-info to be completed right-away + * It can also trigger analysis of some postponed arguments + * We can't treat it as a plain optimization, because it affects the overload resolution in some cases + * e.g: + * ```kotlin + * val x: Int = 1 + * x.plus(run { x }) // Here, to select plus overload we need to analyze lambda + * ``` + */ PARTIAL, UNTIL_FIRST_LAMBDA }