Minor. Reformat some inference files
This commit is contained in:
committed by
Space Team
parent
9a6bff958f
commit
c163f86ecb
+11
-11
@@ -30,8 +30,7 @@ class NewConstraintSystemImpl(
|
||||
ConstraintSystemBuilder,
|
||||
ConstraintInjector.Context,
|
||||
ResultTypeResolver.Context,
|
||||
PostponedArgumentsAnalyzerContext
|
||||
{
|
||||
PostponedArgumentsAnalyzerContext {
|
||||
private val utilContext = constraintInjector.constraintIncorporator.utilContext
|
||||
|
||||
private val postponedComputationsAfterAllVariablesAreFixed = mutableListOf<() -> Unit>()
|
||||
@@ -122,7 +121,7 @@ class NewConstraintSystemImpl(
|
||||
|
||||
override fun addMissedConstraints(
|
||||
position: IncorporationConstraintPosition,
|
||||
constraints: MutableList<Pair<TypeVariableMarker, Constraint>>
|
||||
constraints: MutableList<Pair<TypeVariableMarker, Constraint>>,
|
||||
) {
|
||||
storage.missedConstraints.add(position to constraints)
|
||||
}
|
||||
@@ -172,21 +171,22 @@ class NewConstraintSystemImpl(
|
||||
override fun putBuiltFunctionalExpectedTypeForPostponedArgument(
|
||||
topLevelVariable: TypeConstructorMarker,
|
||||
pathToExpectedType: List<Pair<TypeConstructorMarker, Int>>,
|
||||
builtFunctionalType: KotlinTypeMarker
|
||||
builtFunctionalType: KotlinTypeMarker,
|
||||
) {
|
||||
storage.builtFunctionalTypesForPostponedArgumentsByTopLevelTypeVariables[topLevelVariable to pathToExpectedType] = builtFunctionalType
|
||||
storage.builtFunctionalTypesForPostponedArgumentsByTopLevelTypeVariables[topLevelVariable to pathToExpectedType] =
|
||||
builtFunctionalType
|
||||
}
|
||||
|
||||
override fun putBuiltFunctionalExpectedTypeForPostponedArgument(
|
||||
expectedTypeVariable: TypeConstructorMarker,
|
||||
builtFunctionalType: KotlinTypeMarker
|
||||
builtFunctionalType: KotlinTypeMarker,
|
||||
) {
|
||||
storage.builtFunctionalTypesForPostponedArgumentsByExpectedTypeVariables[expectedTypeVariable] = builtFunctionalType
|
||||
}
|
||||
|
||||
override fun getBuiltFunctionalExpectedTypeForPostponedArgument(
|
||||
topLevelVariable: TypeConstructorMarker,
|
||||
pathToExpectedType: List<Pair<TypeConstructorMarker, Int>>
|
||||
pathToExpectedType: List<Pair<TypeConstructorMarker, Int>>,
|
||||
) = storage.builtFunctionalTypesForPostponedArgumentsByTopLevelTypeVariables[topLevelVariable to pathToExpectedType]
|
||||
|
||||
override fun getBuiltFunctionalExpectedTypeForPostponedArgument(expectedTypeVariable: TypeConstructorMarker) =
|
||||
@@ -479,7 +479,7 @@ class NewConstraintSystemImpl(
|
||||
*/
|
||||
private fun applyConstraintsFromFirstSuccessfulBranchOfTheFork(
|
||||
forkPointData: ForkPointData,
|
||||
position: IncorporationConstraintPosition
|
||||
position: IncorporationConstraintPosition,
|
||||
): Boolean {
|
||||
return forkPointData.any { constraintSetForForkBranch ->
|
||||
runTransaction {
|
||||
@@ -508,7 +508,7 @@ class NewConstraintSystemImpl(
|
||||
override fun fixVariable(
|
||||
variable: TypeVariableMarker,
|
||||
resultType: KotlinTypeMarker,
|
||||
position: FixVariableConstraintPosition<*>
|
||||
position: FixVariableConstraintPosition<*>,
|
||||
) = with(utilContext) {
|
||||
checkState(State.BUILDING, State.COMPLETION)
|
||||
|
||||
@@ -607,7 +607,7 @@ class NewConstraintSystemImpl(
|
||||
|
||||
private fun ConstraintSystemUtilContext.postponeOnlyInputTypesCheck(
|
||||
variableWithConstraints: MutableVariableWithConstraints?,
|
||||
resultType: KotlinTypeMarker
|
||||
resultType: KotlinTypeMarker,
|
||||
) {
|
||||
if (variableWithConstraints != null && variableWithConstraints.typeVariable.hasOnlyInputTypesAttribute()) {
|
||||
postponedComputationsAfterAllVariablesAreFixed.add { checkOnlyInputTypesAnnotation(variableWithConstraints, resultType) }
|
||||
@@ -623,7 +623,7 @@ class NewConstraintSystemImpl(
|
||||
private fun KotlinTypeMarker.substituteAndApproximateIfNecessary(
|
||||
substitutor: TypeSubstitutorMarker,
|
||||
approximator: AbstractTypeApproximator,
|
||||
constraintKind: ConstraintKind
|
||||
constraintKind: ConstraintKind,
|
||||
): KotlinTypeMarker {
|
||||
val doesInputTypeContainsOtherVariables = this.contains { it.typeConstructor() is TypeVariableTypeConstructorMarker }
|
||||
val substitutedType = if (doesInputTypeContainsOtherVariables) substitutor.safeSubstitute(this) else this
|
||||
|
||||
Reference in New Issue
Block a user