[ConstraintSystem] Use new condition element in constraint generation/diagnostics

This commit is contained in:
Pavel Yaskevich
2019-10-22 15:01:39 -07:00
parent 5a12e956f1
commit c4fee1d0c9
3 changed files with 20 additions and 4 deletions

View File

@@ -2578,10 +2578,10 @@ namespace {
if (!boolDecl)
return Type();
CS.addConstraint(ConstraintKind::Conversion,
CS.getType(expr->getCondExpr()),
boolDecl->getDeclaredType(),
CS.getConstraintLocator(expr->getCondExpr()));
CS.addConstraint(
ConstraintKind::Conversion, CS.getType(expr->getCondExpr()),
boolDecl->getDeclaredType(),
CS.getConstraintLocator(expr, LocatorPathElt::Condition()));
// The branches must be convertible to a common type.
return CS.addJoinConstraint(CS.getConstraintLocator(expr),