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 }