[Code completion] Suppress vacuous infix operator completions.

With the previous type-checker change, we end up with some vacuous
infix operator completions, where the right-hand side and result type
are *both* type variables. Suppress these; they aren't useful to the
developer.
This commit is contained in:
Doug Gregor
2016-10-13 10:16:20 -07:00
parent f1c4e14485
commit 735ef839e2

View File

@@ -3313,6 +3313,12 @@ public:
}
}
// If the right-hand side and result type are both type parameters, we're
// not providing a useful completion.
if (expr->getType()->isTypeParameter() &&
CCE.getType()->isTypeParameter())
return;
addInfixOperatorCompletion(op, expr->getType(), CCE.getType());
}
}