mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Sema] Improve diagnostic message for out of order arguments
* Argument numbers are 1 based, not starting from 0. * Use the term `argument` consistently, `parameter` is not a term for call site.
This commit is contained in:
@@ -4255,15 +4255,15 @@ static bool diagnoseSingleCandidateFailures(CalleeCandidateInfo &CCI,
|
||||
|
||||
if (first.empty() && second.empty()) {
|
||||
TC.diagnose(diagLoc, diag::argument_out_of_order_unnamed_unnamed,
|
||||
OOOArgIdx, OOOPrevArgIdx)
|
||||
OOOArgIdx + 1, OOOPrevArgIdx + 1)
|
||||
.fixItExchange(firstRange, secondRange);
|
||||
} else if (first.empty() && !second.empty()) {
|
||||
TC.diagnose(diagLoc, diag::argument_out_of_order_unnamed_named,
|
||||
OOOArgIdx, second)
|
||||
OOOArgIdx + 1, second)
|
||||
.fixItExchange(firstRange, secondRange);
|
||||
} else if (!first.empty() && second.empty()) {
|
||||
TC.diagnose(diagLoc, diag::argument_out_of_order_named_unnamed,
|
||||
first, OOOPrevArgIdx)
|
||||
first, OOOPrevArgIdx + 1)
|
||||
.fixItExchange(firstRange, secondRange);
|
||||
} else {
|
||||
TC.diagnose(diagLoc, diag::argument_out_of_order_named_named,
|
||||
|
||||
Reference in New Issue
Block a user