mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user