@@ -1632,8 +1632,6 @@ ConstraintSystem::matchTupleTypes(TupleType *tuple1, TupleType *tuple2,
1632
1632
case ConstraintKind::ValueMember:
1633
1633
case ConstraintKind::ValueWitness:
1634
1634
case ConstraintKind::BridgingConversion:
1635
- case ConstraintKind::FunctionInput:
1636
- case ConstraintKind::FunctionResult:
1637
1635
case ConstraintKind::OneWayEqual:
1638
1636
case ConstraintKind::OneWayBindParam:
1639
1637
case ConstraintKind::DefaultClosureType:
@@ -1773,8 +1771,6 @@ static bool matchFunctionRepresentations(FunctionType::ExtInfo einfo1,
1773
1771
case ConstraintKind::UnresolvedValueMember:
1774
1772
case ConstraintKind::ValueMember:
1775
1773
case ConstraintKind::ValueWitness:
1776
- case ConstraintKind::FunctionInput:
1777
- case ConstraintKind::FunctionResult:
1778
1774
case ConstraintKind::OneWayEqual:
1779
1775
case ConstraintKind::OneWayBindParam:
1780
1776
case ConstraintKind::DefaultClosureType:
@@ -2178,8 +2174,6 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
2178
2174
case ConstraintKind::ValueMember:
2179
2175
case ConstraintKind::ValueWitness:
2180
2176
case ConstraintKind::BridgingConversion:
2181
- case ConstraintKind::FunctionInput:
2182
- case ConstraintKind::FunctionResult:
2183
2177
case ConstraintKind::OneWayEqual:
2184
2178
case ConstraintKind::OneWayBindParam:
2185
2179
case ConstraintKind::DefaultClosureType:
@@ -5266,8 +5260,6 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
5266
5260
case ConstraintKind::UnresolvedValueMember:
5267
5261
case ConstraintKind::ValueMember:
5268
5262
case ConstraintKind::ValueWitness:
5269
- case ConstraintKind::FunctionInput:
5270
- case ConstraintKind::FunctionResult:
5271
5263
case ConstraintKind::OneWayEqual:
5272
5264
case ConstraintKind::OneWayBindParam:
5273
5265
case ConstraintKind::DefaultClosureType:
@@ -7058,71 +7050,6 @@ ConstraintSystem::simplifyOptionalObjectConstraint(
7058
7050
return SolutionKind::Solved;
7059
7051
}
7060
7052
7061
- // / Attempt to simplify a function input or result constraint.
7062
- ConstraintSystem::SolutionKind
7063
- ConstraintSystem::simplifyFunctionComponentConstraint (
7064
- ConstraintKind kind,
7065
- Type first, Type second,
7066
- TypeMatchOptions flags,
7067
- ConstraintLocatorBuilder locator) {
7068
- auto simplified = simplifyType (first);
7069
- auto simplifiedCopy = simplified;
7070
-
7071
- unsigned unwrapCount = 0 ;
7072
- if (shouldAttemptFixes ()) {
7073
- while (auto objectTy = simplified->getOptionalObjectType ()) {
7074
- simplified = objectTy;
7075
-
7076
- // Track how many times we do this so that we can record a fix for each.
7077
- ++unwrapCount;
7078
- }
7079
-
7080
- if (simplified->isPlaceholder ()) {
7081
- if (auto *typeVar = second->getAs <TypeVariableType>())
7082
- recordPotentialHole (typeVar);
7083
- return SolutionKind::Solved;
7084
- }
7085
- }
7086
-
7087
- if (simplified->isTypeVariableOrMember ()) {
7088
- if (!flags.contains (TMF_GenerateConstraints))
7089
- return SolutionKind::Unsolved;
7090
-
7091
- addUnsolvedConstraint (
7092
- Constraint::create (*this , kind, simplified, second,
7093
- getConstraintLocator (locator)));
7094
- } else if (auto *funcTy = simplified->getAs <FunctionType>()) {
7095
- // Equate it to the other type in the constraint.
7096
- Type type;
7097
- ConstraintLocator::PathElementKind locKind;
7098
-
7099
- if (kind == ConstraintKind::FunctionInput) {
7100
- type = AnyFunctionType::composeTuple (getASTContext (),
7101
- funcTy->getParams ());
7102
- locKind = ConstraintLocator::FunctionArgument;
7103
- } else if (kind == ConstraintKind::FunctionResult) {
7104
- type = funcTy->getResult ();
7105
- locKind = ConstraintLocator::FunctionResult;
7106
- } else {
7107
- llvm_unreachable (" Bad function component constraint kind" );
7108
- }
7109
-
7110
- addConstraint (ConstraintKind::Bind, type, second,
7111
- locator.withPathElement (locKind));
7112
- } else {
7113
- return SolutionKind::Error;
7114
- }
7115
-
7116
- if (unwrapCount > 0 ) {
7117
- auto *fix = ForceOptional::create (*this , simplifiedCopy, second,
7118
- getConstraintLocator (locator));
7119
- if (recordFix (fix, /* impact=*/ unwrapCount))
7120
- return SolutionKind::Error;
7121
- }
7122
-
7123
- return SolutionKind::Solved;
7124
- }
7125
-
7126
7053
static bool isForKeyPathSubscript (ConstraintSystem &cs,
7127
7054
ConstraintLocator *locator) {
7128
7055
if (!locator || !locator->getAnchor ())
@@ -12048,11 +11975,6 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
12048
11975
case ConstraintKind::PropertyWrapper:
12049
11976
return simplifyPropertyWrapperConstraint (first, second, subflags, locator);
12050
11977
12051
- case ConstraintKind::FunctionInput:
12052
- case ConstraintKind::FunctionResult:
12053
- return simplifyFunctionComponentConstraint (kind, first, second,
12054
- subflags, locator);
12055
-
12056
11978
case ConstraintKind::OneWayEqual:
12057
11979
case ConstraintKind::OneWayBindParam:
12058
11980
return simplifyOneWayConstraint (kind, first, second, subflags, locator);
@@ -12582,14 +12504,6 @@ ConstraintSystem::simplifyConstraint(const Constraint &constraint) {
12582
12504
/* flags*/ None,
12583
12505
constraint.getLocator ());
12584
12506
12585
- case ConstraintKind::FunctionInput:
12586
- case ConstraintKind::FunctionResult:
12587
- return simplifyFunctionComponentConstraint (constraint.getKind (),
12588
- constraint.getFirstType (),
12589
- constraint.getSecondType (),
12590
- /* flags*/ None,
12591
- constraint.getLocator ());
12592
-
12593
12507
case ConstraintKind::Disjunction:
12594
12508
case ConstraintKind::Conjunction:
12595
12509
// {Dis, Con}junction constraints are never solved here.
0 commit comments