Skip to content

Commit 3c386d8

Browse files
authored
Merge pull request swiftlang#34052 from xedin/avoid-overload-filtering-when-completing
[ConstraintSystem] Adjust overload filtering to be less aggressive in …
2 parents 638cf56 + a4701f7 commit 3c386d8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8531,6 +8531,12 @@ bool ConstraintSystem::simplifyAppliedOverloadsImpl(
85318531
Constraint *disjunction, TypeVariableType *fnTypeVar,
85328532
const FunctionType *argFnType, unsigned numOptionalUnwraps,
85338533
ConstraintLocatorBuilder locator) {
8534+
// Don't attempt to filter overloads when solving for code completion
8535+
// because presence of code completion token means that any call
8536+
// could be malformed e.g. missing arguments e.g. `foo([.#^MEMBER^#`
8537+
if (isForCodeCompletion())
8538+
return false;
8539+
85348540
if (shouldAttemptFixes()) {
85358541
auto arguments = argFnType->getParams();
85368542
bool allHoles =

0 commit comments

Comments
 (0)