File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -340,11 +340,8 @@ static bool matchCallArgumentsImpl(
340
340
// Go hunting for an unclaimed argument whose name does match.
341
341
Optional<unsigned > claimedWithSameName;
342
342
for (unsigned i = nextArgIdx; i != numArgs; ++i) {
343
- auto argLabel = args[i].getLabel ();
344
343
345
- if (argLabel != paramLabel &&
346
- !(argLabel.str ().startswith (" $" ) &&
347
- argLabel.str ().drop_front () == paramLabel.str ())) {
344
+ if (!args[i].matchParameterLabel (paramLabel)) {
348
345
// If this is an attempt to claim additional unlabeled arguments
349
346
// for variadic parameter, we have to stop at first labeled argument.
350
347
if (forVariadic)
@@ -376,7 +373,7 @@ static bool matchCallArgumentsImpl(
376
373
// func foo(_ a: Int, _ b: Int = 0, c: Int = 0, _ d: Int) {}
377
374
// foo(1, c: 2, 3) // -> `3` will be claimed as '_ b:'.
378
375
// ```
379
- if (argLabel .empty ())
376
+ if (args[i]. getLabel () .empty ())
380
377
continue ;
381
378
382
379
potentiallyOutOfOrder = true ;
You can’t perform that action at this time.
0 commit comments