[FIR] Prepare commonization of PostponedArgumentInputTypesResolver
This commit is contained in:
+25
@@ -5,7 +5,11 @@
|
||||
|
||||
package org.jetbrains.kotlin.resolve.calls.inference.components
|
||||
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.ArgumentConstraintPosition
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.FixVariableConstraintPosition
|
||||
import org.jetbrains.kotlin.resolve.calls.model.PostponedAtomWithRevisableExpectedType
|
||||
import org.jetbrains.kotlin.types.model.KotlinTypeMarker
|
||||
import org.jetbrains.kotlin.types.model.TypeConstructorMarker
|
||||
import org.jetbrains.kotlin.types.model.TypeVariableMarker
|
||||
|
||||
/*
|
||||
@@ -19,4 +23,25 @@ interface ConstraintSystemUtilContext {
|
||||
fun KotlinTypeMarker.unCapture(): KotlinTypeMarker
|
||||
fun TypeVariableMarker.isReified(): Boolean
|
||||
fun KotlinTypeMarker.refineType(): KotlinTypeMarker
|
||||
|
||||
// PostponedArgumentInputTypesResolver
|
||||
fun extractFunctionalTypeFromSupertypes(type: KotlinTypeMarker): KotlinTypeMarker
|
||||
fun KotlinTypeMarker.extractArgumentsForFunctionalTypeOrSubtype(): List<KotlinTypeMarker>
|
||||
fun KotlinTypeMarker.isFunctionOrKFunctionTypeWithAnySuspendability(): Boolean
|
||||
fun KotlinTypeMarker.isSuspendFunctionTypeOrSubtype(): Boolean
|
||||
fun <T> createArgumentConstraintPosition(argument: T): ArgumentConstraintPosition<T>
|
||||
fun <T> createFixVariableConstraintPosition(variable: TypeVariableMarker, atom: T): FixVariableConstraintPosition<T>
|
||||
fun extractParameterTypesFromDeclaration(declaration: PostponedAtomWithRevisableExpectedType): List<KotlinTypeMarker?>?
|
||||
fun KotlinTypeMarker.isExtensionFunctionType(): Boolean
|
||||
fun getFunctionTypeConstructor(parametersNumber: Int, isSuspend: Boolean): TypeConstructorMarker
|
||||
fun getKFunctionTypeConstructor(parametersNumber: Int, isSuspend: Boolean): TypeConstructorMarker
|
||||
fun isAnonymousFunction(argument: PostponedAtomWithRevisableExpectedType): Boolean
|
||||
fun PostponedAtomWithRevisableExpectedType.isFunctionExpressionWithReceiver(): Boolean
|
||||
fun createTypeVariableForLambdaReturnType(): TypeVariableMarker
|
||||
fun createTypeVariableForLambdaParameterType(argument: PostponedAtomWithRevisableExpectedType, index: Int): TypeVariableMarker
|
||||
fun createTypeVariableForCallableReferenceParameterType(
|
||||
argument: PostponedAtomWithRevisableExpectedType,
|
||||
index: Int
|
||||
): TypeVariableMarker
|
||||
fun createTypeVariableForCallableReferenceReturnType(): TypeVariableMarker
|
||||
}
|
||||
|
||||
+15
@@ -10,5 +10,20 @@ import org.jetbrains.kotlin.types.model.KotlinTypeMarker
|
||||
interface PostponedResolvedAtomMarker {
|
||||
val inputTypes: Collection<KotlinTypeMarker>
|
||||
val outputType: KotlinTypeMarker?
|
||||
val expectedType: KotlinTypeMarker?
|
||||
val analyzed: Boolean
|
||||
}
|
||||
|
||||
interface PostponedAtomWithRevisableExpectedType : PostponedResolvedAtomMarker {
|
||||
val revisedExpectedType: KotlinTypeMarker?
|
||||
|
||||
fun reviseExpectedType(expectedType: KotlinTypeMarker)
|
||||
}
|
||||
|
||||
interface PostponedCallableReferenceMarker : PostponedAtomWithRevisableExpectedType
|
||||
|
||||
interface LambdaWithTypeVariableAsExpectedTypeMarker : PostponedAtomWithRevisableExpectedType {
|
||||
val parameterTypesFromDeclaration: List<KotlinTypeMarker?>?
|
||||
|
||||
fun updateParameterTypesFromDeclaration(types: List<KotlinTypeMarker?>?)
|
||||
}
|
||||
Reference in New Issue
Block a user