[CodeCompletion] Fix call-arg completion when we remove all the overloads we found

We have code for pruning unlikely overloads, but when it pruned all
overloads it was treating that as if there was nothing to complete.
Instead, fallback to postfix-expr-begin.

We should also figure out why we're not getting any viable types here,
but we need to handle failure gracefully.

rdar://problem/24356118
This commit is contained in:
Ben Langmuir
2016-03-15 12:16:41 -07:00
parent 069612bccc
commit 8c0d5408b7
2 changed files with 21 additions and 1 deletions

View File

@@ -3505,8 +3505,10 @@ public:
if (PossibleTypes.empty() &&
!typeCheckUnresolvedExpr(DC, CallE->getArg(), CallE, PossibleTypes))
return false;
if (RemoveUnlikelyOverloads)
if (RemoveUnlikelyOverloads) {
removeUnlikelyOverloads(PossibleTypes, TupleEleTypesBeforeTarget, &DC);
return !PossibleTypes.empty();
}
} else if (CallE->getArg()->getKind() == ExprKind::Paren) {
Position = 0;
HasName = false;