mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #41917 from ahoppen/pr/filter-overloads-if-no-cc-token
[CodeCompletion] Filter overloads if their function application doesn't contain the code completion token
This commit is contained in:
@@ -10774,8 +10774,12 @@ bool ConstraintSystem::simplifyAppliedOverloadsImpl(
|
||||
// Don't attempt to filter overloads when solving for code completion
|
||||
// because presence of code completion token means that any call
|
||||
// could be malformed e.g. missing arguments e.g. `foo([.#^MEMBER^#`
|
||||
if (isForCodeCompletion())
|
||||
return false;
|
||||
if (isForCodeCompletion()) {
|
||||
bool ArgContainsCCTypeVar = Type(argFnType).findIf(isCodeCompletionTypeVar);
|
||||
if (ArgContainsCCTypeVar || isCodeCompletionTypeVar(fnTypeVar)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldAttemptFixes()) {
|
||||
auto arguments = argFnType->getParams();
|
||||
|
||||
Reference in New Issue
Block a user