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(
340340 // Go hunting for an unclaimed argument whose name does match.
341341 Optional<unsigned > claimedWithSameName;
342342 for (unsigned i = nextArgIdx; i != numArgs; ++i) {
343- auto argLabel = args[i].getLabel ();
344343
345- if (argLabel != paramLabel &&
346- !(argLabel.str ().startswith (" $" ) &&
347- argLabel.str ().drop_front () == paramLabel.str ())) {
344+ if (!args[i].matchParameterLabel (paramLabel)) {
348345 // If this is an attempt to claim additional unlabeled arguments
349346 // for variadic parameter, we have to stop at first labeled argument.
350347 if (forVariadic)
@@ -376,7 +373,7 @@ static bool matchCallArgumentsImpl(
376373 // func foo(_ a: Int, _ b: Int = 0, c: Int = 0, _ d: Int) {}
377374 // foo(1, c: 2, 3) // -> `3` will be claimed as '_ b:'.
378375 // ```
379- if (argLabel .empty ())
376+ if (args[i]. getLabel () .empty ())
380377 continue ;
381378
382379 potentiallyOutOfOrder = true ;
You can’t perform that action at this time.
0 commit comments