@@ -2284,7 +2284,7 @@ ConstraintSystem::matchTupleTypes(TupleType *tuple1, TupleType *tuple2,
22842284 case ConstraintKind::BridgingConversion:
22852285 case ConstraintKind::OneWayEqual:
22862286 case ConstraintKind::OneWayBindParam:
2287- case ConstraintKind::DefaultClosureType :
2287+ case ConstraintKind::FallbackType :
22882288 case ConstraintKind::UnresolvedMemberChainBase:
22892289 case ConstraintKind::PropertyWrapper:
22902290 case ConstraintKind::SyntacticElement:
@@ -2643,7 +2643,7 @@ static bool matchFunctionRepresentations(FunctionType::ExtInfo einfo1,
26432643 case ConstraintKind::ValueWitness:
26442644 case ConstraintKind::OneWayEqual:
26452645 case ConstraintKind::OneWayBindParam:
2646- case ConstraintKind::DefaultClosureType :
2646+ case ConstraintKind::FallbackType :
26472647 case ConstraintKind::UnresolvedMemberChainBase:
26482648 case ConstraintKind::PropertyWrapper:
26492649 case ConstraintKind::SyntacticElement:
@@ -3161,7 +3161,7 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
31613161 case ConstraintKind::BridgingConversion:
31623162 case ConstraintKind::OneWayEqual:
31633163 case ConstraintKind::OneWayBindParam:
3164- case ConstraintKind::DefaultClosureType :
3164+ case ConstraintKind::FallbackType :
31653165 case ConstraintKind::UnresolvedMemberChainBase:
31663166 case ConstraintKind::PropertyWrapper:
31673167 case ConstraintKind::SyntacticElement:
@@ -6811,7 +6811,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
68116811 case ConstraintKind::ValueWitness:
68126812 case ConstraintKind::OneWayEqual:
68136813 case ConstraintKind::OneWayBindParam:
6814- case ConstraintKind::DefaultClosureType :
6814+ case ConstraintKind::FallbackType :
68156815 case ConstraintKind::UnresolvedMemberChainBase:
68166816 case ConstraintKind::PropertyWrapper:
68176817 case ConstraintKind::SyntacticElement:
@@ -10989,18 +10989,18 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyDefaultableConstraint(
1098910989 return SolutionKind::Solved;
1099010990}
1099110991
10992- ConstraintSystem::SolutionKind
10993- ConstraintSystem::simplifyDefaultClosureTypeConstraint(
10994- Type closureType, Type inferredType ,
10995- ArrayRef<TypeVariableType *> referencedOuterParameters,
10996- TypeMatchOptions flags, ConstraintLocatorBuilder locator) {
10997- closureType = getFixedTypeRecursive(closureType , flags, /*wantRValue=*/true);
10992+ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFallbackTypeConstraint(
10993+ Type defaultableType, Type fallbackType,
10994+ ArrayRef<TypeVariableType *> referencedVars, TypeMatchOptions flags ,
10995+ ConstraintLocatorBuilder locator) {
10996+ defaultableType =
10997+ getFixedTypeRecursive(defaultableType , flags, /*wantRValue=*/true);
1099810998
10999- if (closureType ->isTypeVariableOrMember()) {
10999+ if (defaultableType ->isTypeVariableOrMember()) {
1100011000 if (flags.contains(TMF_GenerateConstraints)) {
1100111001 addUnsolvedConstraint(Constraint::create(
11002- *this, ConstraintKind::DefaultClosureType, closureType, inferredType ,
11003- getConstraintLocator(locator), referencedOuterParameters ));
11002+ *this, ConstraintKind::FallbackType, defaultableType, fallbackType ,
11003+ getConstraintLocator(locator), referencedVars ));
1100411004 return SolutionKind::Solved;
1100511005 }
1100611006
@@ -15065,7 +15065,7 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
1506515065 case ConstraintKind::Conjunction:
1506615066 case ConstraintKind::KeyPath:
1506715067 case ConstraintKind::KeyPathApplication:
15068- case ConstraintKind::DefaultClosureType :
15068+ case ConstraintKind::FallbackType :
1506915069 case ConstraintKind::SyntacticElement:
1507015070 llvm_unreachable("Use the correct addConstraint()");
1507115071 }
@@ -15597,12 +15597,12 @@ ConstraintSystem::simplifyConstraint(const Constraint &constraint) {
1559715597 /*flags*/ None,
1559815598 constraint.getLocator());
1559915599
15600- case ConstraintKind::DefaultClosureType :
15601- return simplifyDefaultClosureTypeConstraint (constraint.getFirstType(),
15602- constraint.getSecondType(),
15603- constraint.getTypeVariables(),
15604- /*flags*/ None,
15605- constraint.getLocator());
15600+ case ConstraintKind::FallbackType :
15601+ return simplifyFallbackTypeConstraint (constraint.getFirstType(),
15602+ constraint.getSecondType(),
15603+ constraint.getTypeVariables(),
15604+ /*flags*/ None,
15605+ constraint.getLocator());
1560615606
1560715607 case ConstraintKind::PropertyWrapper:
1560815608 return simplifyPropertyWrapperConstraint(constraint.getFirstType(),
0 commit comments