mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user