Skip to content

Commit 1ef2c59

Browse files
authored
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
2 parents 2697e96 + 045302b commit 1ef2c59

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10774,8 +10774,12 @@ bool ConstraintSystem::simplifyAppliedOverloadsImpl(
1077410774
// Don't attempt to filter overloads when solving for code completion
1077510775
// because presence of code completion token means that any call
1077610776
// could be malformed e.g. missing arguments e.g. `foo([.#^MEMBER^#`
10777-
if (isForCodeCompletion())
10778-
return false;
10777+
if (isForCodeCompletion()) {
10778+
bool ArgContainsCCTypeVar = Type(argFnType).findIf(isCodeCompletionTypeVar);
10779+
if (ArgContainsCCTypeVar || isCodeCompletionTypeVar(fnTypeVar)) {
10780+
return false;
10781+
}
10782+
}
1077910783

1078010784
if (shouldAttemptFixes()) {
1078110785
auto arguments = argFnType->getParams();

0 commit comments

Comments
 (0)