[Diagnostics] NFC: Remove "trailing" from method name for closures with missing args

`MissingArgumentsFailure::diagnoseClosure` can actually diagnose both
closures in argument positions as well as when their type comes from
context e.g. `let _: (Int) -> Void = {}`.
This commit is contained in:
Pavel Yaskevich
2019-09-17 10:34:40 -07:00
parent 4d02463e2b
commit 0aeaf7f15e
2 changed files with 4 additions and 4 deletions

View File

@@ -3509,12 +3509,12 @@ bool MissingArgumentsFailure::diagnoseAsError() {
anchor = captureList->getClosureBody();
if (auto *closure = dyn_cast<ClosureExpr>(anchor))
return diagnoseTrailingClosure(closure);
return diagnoseClosure(closure);
return false;
}
bool MissingArgumentsFailure::diagnoseTrailingClosure(ClosureExpr *closure) {
bool MissingArgumentsFailure::diagnoseClosure(ClosureExpr *closure) {
auto &cs = getConstraintSystem();
FunctionType *funcType = nullptr;

View File

@@ -1192,9 +1192,9 @@ public:
bool diagnoseAsError() override;
private:
/// If missing arguments come from trailing closure,
/// If missing arguments come from a closure,
/// let's produce tailored diagnostics.
bool diagnoseTrailingClosure(ClosureExpr *closure);
bool diagnoseClosure(ClosureExpr *closure);
};
class OutOfOrderArgumentFailure final : public FailureDiagnostic {