[ConstraintSystem] NFC: Generalize DefaultClosureType constraint

This constraint is useful in more places than closures because
it gives a way to provide a "fallback type" without it having
effect on inference.
This commit is contained in:
Pavel Yaskevich
2023-06-16 09:28:00 -07:00
parent 612a2e79fa
commit 2ee646f47b
8 changed files with 48 additions and 50 deletions

View File

@@ -4852,11 +4852,12 @@ private:
TypeMatchOptions flags,
ConstraintLocatorBuilder locator);
/// Attempt to simplify the given defaultable closure type constraint.
SolutionKind simplifyDefaultClosureTypeConstraint(
Type closureType, Type inferredType,
ArrayRef<TypeVariableType *> referencedOuterParameters,
TypeMatchOptions flags, ConstraintLocatorBuilder locator);
/// Attempt to simplify the given fallback type constraint.
SolutionKind
simplifyFallbackTypeConstraint(Type defaultableType, Type fallbackType,
ArrayRef<TypeVariableType *> referencedVars,
TypeMatchOptions flags,
ConstraintLocatorBuilder locator);
/// Attempt to simplify a property wrapper constraint.
SolutionKind simplifyPropertyWrapperConstraint(Type wrapperType, Type wrappedValueType,