@@ -2284,7 +2284,7 @@ ConstraintSystem::matchTupleTypes(TupleType *tuple1, TupleType *tuple2,
2284
2284
case ConstraintKind::BridgingConversion:
2285
2285
case ConstraintKind::OneWayEqual:
2286
2286
case ConstraintKind::OneWayBindParam:
2287
- case ConstraintKind::DefaultClosureType :
2287
+ case ConstraintKind::FallbackType :
2288
2288
case ConstraintKind::UnresolvedMemberChainBase:
2289
2289
case ConstraintKind::PropertyWrapper:
2290
2290
case ConstraintKind::SyntacticElement:
@@ -2643,7 +2643,7 @@ static bool matchFunctionRepresentations(FunctionType::ExtInfo einfo1,
2643
2643
case ConstraintKind::ValueWitness:
2644
2644
case ConstraintKind::OneWayEqual:
2645
2645
case ConstraintKind::OneWayBindParam:
2646
- case ConstraintKind::DefaultClosureType :
2646
+ case ConstraintKind::FallbackType :
2647
2647
case ConstraintKind::UnresolvedMemberChainBase:
2648
2648
case ConstraintKind::PropertyWrapper:
2649
2649
case ConstraintKind::SyntacticElement:
@@ -3161,7 +3161,7 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
3161
3161
case ConstraintKind::BridgingConversion:
3162
3162
case ConstraintKind::OneWayEqual:
3163
3163
case ConstraintKind::OneWayBindParam:
3164
- case ConstraintKind::DefaultClosureType :
3164
+ case ConstraintKind::FallbackType :
3165
3165
case ConstraintKind::UnresolvedMemberChainBase:
3166
3166
case ConstraintKind::PropertyWrapper:
3167
3167
case ConstraintKind::SyntacticElement:
@@ -6814,7 +6814,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
6814
6814
case ConstraintKind::ValueWitness:
6815
6815
case ConstraintKind::OneWayEqual:
6816
6816
case ConstraintKind::OneWayBindParam:
6817
- case ConstraintKind::DefaultClosureType :
6817
+ case ConstraintKind::FallbackType :
6818
6818
case ConstraintKind::UnresolvedMemberChainBase:
6819
6819
case ConstraintKind::PropertyWrapper:
6820
6820
case ConstraintKind::SyntacticElement:
@@ -10950,18 +10950,18 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyDefaultableConstraint(
10950
10950
return SolutionKind::Solved;
10951
10951
}
10952
10952
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);
10959
10959
10960
- if (closureType ->isTypeVariableOrMember()) {
10960
+ if (defaultableType ->isTypeVariableOrMember()) {
10961
10961
if (flags.contains(TMF_GenerateConstraints)) {
10962
10962
addUnsolvedConstraint(Constraint::create(
10963
- *this, ConstraintKind::DefaultClosureType, closureType, inferredType ,
10964
- getConstraintLocator(locator), referencedOuterParameters ));
10963
+ *this, ConstraintKind::FallbackType, defaultableType, fallbackType ,
10964
+ getConstraintLocator(locator), referencedVars ));
10965
10965
return SolutionKind::Solved;
10966
10966
}
10967
10967
@@ -15014,7 +15014,7 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
15014
15014
case ConstraintKind::Conjunction:
15015
15015
case ConstraintKind::KeyPath:
15016
15016
case ConstraintKind::KeyPathApplication:
15017
- case ConstraintKind::DefaultClosureType :
15017
+ case ConstraintKind::FallbackType :
15018
15018
case ConstraintKind::SyntacticElement:
15019
15019
llvm_unreachable("Use the correct addConstraint()");
15020
15020
}
@@ -15546,12 +15546,12 @@ ConstraintSystem::simplifyConstraint(const Constraint &constraint) {
15546
15546
/*flags*/ None,
15547
15547
constraint.getLocator());
15548
15548
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());
15555
15555
15556
15556
case ConstraintKind::PropertyWrapper:
15557
15557
return simplifyPropertyWrapperConstraint(constraint.getFirstType(),
0 commit comments