Diagnostics: Ported tuple mismatch diagnostic to new diagnostic framework

This commit is contained in:
Sam Lazarus
2019-07-23 15:28:53 -04:00
parent b28b44b9c7
commit a3b56c2790
9 changed files with 115 additions and 14 deletions

View File

@@ -229,6 +229,18 @@ ContextualMismatch *ContextualMismatch::create(ConstraintSystem &cs, Type lhs,
return new (cs.getAllocator()) ContextualMismatch(cs, lhs, rhs, locator);
}
bool AllowTupleTypeMismatch::diagnose(Expr *root, bool asNote) const {
auto failure = TupleContextualFailure(root, getConstraintSystem(), LHS, RHS,
getLocator());
return failure.diagnose(asNote);
}
AllowTupleTypeMismatch *
AllowTupleTypeMismatch::create(ConstraintSystem &cs, Type lhs, Type rhs,
ConstraintLocator *locator) {
return new (cs.getAllocator()) AllowTupleTypeMismatch(cs, lhs, rhs, locator);
}
bool GenericArgumentsMismatch::diagnose(Expr *root, bool asNote) const {
auto failure = GenericArgumentsMismatchFailure(root, getConstraintSystem(),
getActual(), getRequired(),