Revert "[ConstraintSystem] Use semantics providing exprs when dealing with favored types."

This reverts commit 2f80af15ec.

I expected this to have no effect, but it results in one of the
expression type checker tests taking longer, so that test was disabled.

This commit also re-enables the test since it now passes again.
This commit is contained in:
Mark Lacey
2017-12-02 21:45:37 -08:00
parent 5e7aba6568
commit 66a11ce66b
3 changed files with 18 additions and 5 deletions

View File

@@ -916,6 +916,18 @@ namespace {
}
}
// If the paren expr has a favored type, and the subExpr doesn't,
// propagate downwards. Otherwise, propagate upwards.
if (auto parenExpr = dyn_cast<ParenExpr>(expr)) {
if (!CS.getFavoredType(parenExpr->getSubExpr())) {
CS.setFavoredType(parenExpr->getSubExpr(),
CS.getFavoredType(parenExpr));
} else if (!CS.getFavoredType(parenExpr)) {
CS.setFavoredType(parenExpr,
CS.getFavoredType(parenExpr->getSubExpr()));
}
}
return { true, expr };
}
@@ -1607,6 +1619,10 @@ namespace {
}
virtual Type visitParenExpr(ParenExpr *expr) {
if (auto favoredTy = CS.getFavoredType(expr->getSubExpr())) {
CS.setFavoredType(expr, favoredTy);
}
auto &ctx = CS.getASTContext();
auto parenType = CS.getType(expr->getSubExpr())->getInOutObjectType();
auto parenFlags = ParameterTypeFlags().withInOut(expr->isSemanticallyInOutExpr());