[ConstraintSystem] Specialize diagnostic for ~= to talk about expression pattern use

This commit is contained in:
Pavel Yaskevich
2020-05-20 20:12:43 -07:00
parent ac2305e7f1
commit 9067ed23ca
2 changed files with 4 additions and 0 deletions

View File

@@ -2814,6 +2814,9 @@ static void diagnoseOperatorAmbiguity(ConstraintSystem &cs,
operatorName.str());
return;
}
} else if (operatorName.is("~=")) {
DE.diagnose(anchor->getLoc(), diag::cannot_match_expr_pattern_with_value,
lhsType, rhsType);
} else {
DE.diagnose(anchor->getLoc(), diag::cannot_apply_binop_to_args,
operatorName.str(), lhsType, rhsType)