@@ -135,34 +135,6 @@ bool constraints::areConservativelyCompatibleArgumentLabels(
135135 hasCurriedSelf = true ;
136136 }
137137
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) {
166138 const AnyFunctionType *fTy ;
167139
168140 if (auto fn = dyn_cast<AbstractFunctionDecl>(decl)) {
@@ -173,7 +145,7 @@ areConservativelyCompatibleArgumentLabels(ValueDecl *decl,
173145 } else {
174146 return true ;
175147 }
176-
148+
177149 SmallVector<AnyFunctionType::Param, 8 > argInfos;
178150 for (auto argLabel : labels) {
179151 argInfos.push_back (AnyFunctionType::Param (Type (), argLabel, {}));
@@ -184,7 +156,7 @@ areConservativelyCompatibleArgumentLabels(ValueDecl *decl,
184156 levelTy = levelTy->getResult ()->getAs <AnyFunctionType>();
185157 assert (levelTy && " Parameter list curry level does not match type" );
186158 }
187-
159+
188160 auto params = levelTy->getParams ();
189161 SmallBitVector defaultMap =
190162 computeDefaultMap (params, decl, hasCurriedSelf);
@@ -198,6 +170,25 @@ areConservativelyCompatibleArgumentLabels(ValueDecl *decl,
198170 listener, unusedParamBindings);
199171}
200172
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+
201192// / Determine the default type-matching options to use when decomposing a
202193// / constraint into smaller constraints.
203194static ConstraintSystem::TypeMatchOptions getDefaultDecompositionOptions (
0 commit comments