mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user