Normalize the way paren types are stripped in Sema.

This commit is contained in:
Robert Widmann
2016-10-06 16:01:32 -04:00
parent 59aefbc511
commit f59d5cb577
6 changed files with 8 additions and 30 deletions

View File

@@ -699,14 +699,6 @@ namespace {
return NTD->getHasFailableInits();
}
Type getInnerParenType(const Type &t) {
if (auto parenType = dyn_cast<ParenType>(t.getPointer())) {
return getInnerParenType(parenType->getUnderlyingType());
}
return t;
}
size_t getOperandCount(Type t) {
size_t nOperands = 0;
@@ -874,8 +866,8 @@ namespace {
auto argTy = expr->getArg()->getType();
auto argTupleTy = argTy->castTo<TupleType>();
auto argTupleExpr = dyn_cast<TupleExpr>(expr->getArg());
Type firstArgTy = getInnerParenType(argTupleTy->getElement(0).getType());
Type secondArgTy = getInnerParenType(argTupleTy->getElement(1).getType());
Type firstArgTy = argTupleTy->getElement(0).getType()->getWithoutParens();
Type secondArgTy = argTupleTy->getElement(1).getType()->getWithoutParens();
// Determine whether the given declaration is favored.
auto isFavoredDecl = [&](ValueDecl *value) -> bool {