Simplify conditional expression: (A && !B) || (!A && B) is equivalent to bool(A) != bool(B)

This commit is contained in:
Valeriy Van
2022-12-19 13:49:46 +02:00
parent 54f9cae4da
commit 194ecff898

View File

@@ -5645,8 +5645,7 @@ bool ConstraintSystem::repairFailures(
auto *parentLoc = getConstraintLocator(anchor, path);
if ((lhs->is<InOutType>() && !rhs->is<InOutType>()) ||
(!lhs->is<InOutType>() && rhs->is<InOutType>())) {
if (lhs->is<InOutType>() != rhs->is<InOutType>()) {
// Since `FunctionArgument` as a last locator element represents
// a single parameter of the function type involved in a conversion
// to another function type, see `matchFunctionTypes`. If there is already