@@ -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:
@@ -6814,7 +6814,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
68146814 case ConstraintKind::ValueWitness:
68156815 case ConstraintKind::OneWayEqual:
68166816 case ConstraintKind::OneWayBindParam:
6817- case ConstraintKind::DefaultClosureType :
6817+ case ConstraintKind::FallbackType :
68186818 case ConstraintKind::UnresolvedMemberChainBase:
68196819 case ConstraintKind::PropertyWrapper:
68206820 case ConstraintKind::SyntacticElement:
@@ -10950,18 +10950,18 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyDefaultableConstraint(
1095010950 return SolutionKind::Solved;
1095110951}
1095210952
10953- ConstraintSystem::SolutionKind
10954- ConstraintSystem::simplifyDefaultClosureTypeConstraint(
10955- Type closureType, Type inferredType ,
10956- ArrayRef<TypeVariableType *> referencedOuterParameters,
10957- TypeMatchOptions flags, ConstraintLocatorBuilder locator) {
10958- closureType = getFixedTypeRecursive(closureType , flags, /*wantRValue=*/true);
10953+ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFallbackTypeConstraint(
10954+ Type defaultableType, Type fallbackType,
10955+ ArrayRef<TypeVariableType *> referencedVars, TypeMatchOptions flags ,
10956+ ConstraintLocatorBuilder locator) {
10957+ defaultableType =
10958+ getFixedTypeRecursive(defaultableType , flags, /*wantRValue=*/true);
1095910959
10960- if (closureType ->isTypeVariableOrMember()) {
10960+ if (defaultableType ->isTypeVariableOrMember()) {
1096110961 if (flags.contains(TMF_GenerateConstraints)) {
1096210962 addUnsolvedConstraint(Constraint::create(
10963- *this, ConstraintKind::DefaultClosureType, closureType, inferredType ,
10964- getConstraintLocator(locator), referencedOuterParameters ));
10963+ *this, ConstraintKind::FallbackType, defaultableType, fallbackType ,
10964+ getConstraintLocator(locator), referencedVars ));
1096510965 return SolutionKind::Solved;
1096610966 }
1096710967
@@ -15014,7 +15014,7 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
1501415014 case ConstraintKind::Conjunction:
1501515015 case ConstraintKind::KeyPath:
1501615016 case ConstraintKind::KeyPathApplication:
15017- case ConstraintKind::DefaultClosureType :
15017+ case ConstraintKind::FallbackType :
1501815018 case ConstraintKind::SyntacticElement:
1501915019 llvm_unreachable("Use the correct addConstraint()");
1502015020 }
@@ -15546,12 +15546,12 @@ ConstraintSystem::simplifyConstraint(const Constraint &constraint) {
1554615546 /*flags*/ None,
1554715547 constraint.getLocator());
1554815548
15549- case ConstraintKind::DefaultClosureType :
15550- return simplifyDefaultClosureTypeConstraint (constraint.getFirstType(),
15551- constraint.getSecondType(),
15552- constraint.getTypeVariables(),
15553- /*flags*/ None,
15554- constraint.getLocator());
15549+ case ConstraintKind::FallbackType :
15550+ return simplifyFallbackTypeConstraint (constraint.getFirstType(),
15551+ constraint.getSecondType(),
15552+ constraint.getTypeVariables(),
15553+ /*flags*/ None,
15554+ constraint.getLocator());
1555515555
1555615556 case ConstraintKind::PropertyWrapper:
1555715557 return simplifyPropertyWrapperConstraint(constraint.getFirstType(),
0 commit comments