@@ -135,34 +135,6 @@ bool constraints::areConservativelyCompatibleArgumentLabels(
135
135
hasCurriedSelf = true ;
136
136
}
137
137
138
- return areConservativelyCompatibleArgumentLabels (
139
- decl, hasCurriedSelf, labels, hasTrailingClosure);
140
- }
141
-
142
- Expr *constraints::getArgumentLabelTargetExpr (Expr *fn) {
143
- // Dig out the function, looking through, parentheses, ?, and !.
144
- do {
145
- fn = fn->getSemanticsProvidingExpr ();
146
-
147
- if (auto force = dyn_cast<ForceValueExpr>(fn)) {
148
- fn = force->getSubExpr ();
149
- continue ;
150
- }
151
-
152
- if (auto bind = dyn_cast<BindOptionalExpr>(fn)) {
153
- fn = bind->getSubExpr ();
154
- continue ;
155
- }
156
-
157
- return fn;
158
- } while (true );
159
- }
160
-
161
- bool constraints::
162
- areConservativelyCompatibleArgumentLabels (ValueDecl *decl,
163
- bool hasCurriedSelf,
164
- ArrayRef<Identifier> labels,
165
- bool hasTrailingClosure) {
166
138
const AnyFunctionType *fTy ;
167
139
168
140
if (auto fn = dyn_cast<AbstractFunctionDecl>(decl)) {
@@ -173,7 +145,7 @@ areConservativelyCompatibleArgumentLabels(ValueDecl *decl,
173
145
} else {
174
146
return true ;
175
147
}
176
-
148
+
177
149
SmallVector<AnyFunctionType::Param, 8 > argInfos;
178
150
for (auto argLabel : labels) {
179
151
argInfos.push_back (AnyFunctionType::Param (Type (), argLabel, {}));
@@ -184,7 +156,7 @@ areConservativelyCompatibleArgumentLabels(ValueDecl *decl,
184
156
levelTy = levelTy->getResult ()->getAs <AnyFunctionType>();
185
157
assert (levelTy && " Parameter list curry level does not match type" );
186
158
}
187
-
159
+
188
160
auto params = levelTy->getParams ();
189
161
SmallBitVector defaultMap =
190
162
computeDefaultMap (params, decl, hasCurriedSelf);
@@ -198,6 +170,25 @@ areConservativelyCompatibleArgumentLabels(ValueDecl *decl,
198
170
listener, unusedParamBindings);
199
171
}
200
172
173
+ Expr *constraints::getArgumentLabelTargetExpr (Expr *fn) {
174
+ // Dig out the function, looking through, parentheses, ?, and !.
175
+ do {
176
+ fn = fn->getSemanticsProvidingExpr ();
177
+
178
+ if (auto force = dyn_cast<ForceValueExpr>(fn)) {
179
+ fn = force->getSubExpr ();
180
+ continue ;
181
+ }
182
+
183
+ if (auto bind = dyn_cast<BindOptionalExpr>(fn)) {
184
+ fn = bind->getSubExpr ();
185
+ continue ;
186
+ }
187
+
188
+ return fn;
189
+ } while (true );
190
+ }
191
+
201
192
// / Determine the default type-matching options to use when decomposing a
202
193
// / constraint into smaller constraints.
203
194
static ConstraintSystem::TypeMatchOptions getDefaultDecompositionOptions (
0 commit comments