FIR. Document current builder inference algorithm

This commit is contained in:
Simon Ogorodnik
2023-05-05 18:38:48 +02:00
committed by Space Team
parent 987e8c25dc
commit 4d1ea06c17
3 changed files with 219 additions and 0 deletions
@@ -174,6 +174,12 @@ class ConstraintSystemCompleter(components: BodyResolveComponents, private val c
}
}
/**
* General documentation for builder inference algorithm is located at `/docs/fir/builder_inference.md`
*
* This function checks if any of the postponed arguments are suitable for builder inference, and performs it for all eligible lambda arguments
* @return true if we got new proper constraints after builder inference
*/
private fun ConstraintSystemCompletionContext.tryToCompleteWithBuilderInference(
completionMode: ConstraintSystemCompletionMode,
topLevelType: ConeKotlinType,
@@ -31,6 +31,9 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.BUILDER_INFERENCE_ANNOTATION_
import org.jetbrains.kotlin.types.model.TypeConstructorMarker
import org.jetbrains.kotlin.types.model.TypeVariableMarker
/**
* General documentation for builder inference algorithm is located at `/docs/fir/builder_inference.md`
*/
class FirBuilderInferenceSession(
private val lambda: FirAnonymousFunction,
resolutionContext: ResolutionContext,