[AST] NFC: De-boilerplate "has ParenType sugar"

This commit is contained in:
David Zarzycki
2017-12-29 11:37:20 -05:00
parent 41a0553228
commit 62795501d9
10 changed files with 19 additions and 18 deletions

View File

@@ -40,7 +40,7 @@ namespace swift {
// Always make sure to have at least one set of parens
bool forceParens =
!type->is<TupleType>() && !isa<ParenType>(type.getPointer());
!type->is<TupleType>() && !type->hasParenSugar();
if (forceParens)
result.push_back('(');
@@ -4110,7 +4110,7 @@ public:
// FIXME: Due to a quirk of CSApply, we can end up without a
// ParenExpr if the argument has an '@lvalue TupleType'.
assert((isa<TupleType>(CS.getType(ArgExpr).getPointer()) ||
isa<ParenType>(CS.getType(ArgExpr).getPointer())) &&
CS.getType(ArgExpr)->hasParenSugar()) &&
"unexpected argument expression type");
insertLoc = ArgExpr->getLoc();