Skip to content

Commit d082ebb

Browse files
committed
[CodeCompletion] Don't report an extra argument failure if the code completion token is the first one in a call
This makes sure we don't penalize overloads with no arguments when calling ```swift func foo() {} func foo(_ arg: Int) {} foo(#^COMPLETE^# ```
1 parent 237376b commit d082ebb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,6 +1275,9 @@ class CompletionArgumentTracker : public ArgumentFailureTracker {
12751275
if (ArgInfo.isBefore(argIdx)) {
12761276
return false;
12771277
}
1278+
if (argIdx == 0 && ArgInfo.completionIdx == 0) {
1279+
return false;
1280+
}
12781281
return ArgumentFailureTracker::extraArgument(argIdx);
12791282
}
12801283

0 commit comments

Comments
 (0)