Make getWitnessType() return Type() for ErrorType.

None of the clients of this care about distinguishing between immediate
failures in getWitnessType() vs. earlier errors that result in
getWitnessType() returning ErrorType, so simplify the interface by
having it always return Type() if there is a problem.

Update the clients that were not already checking for null result to do
so.

Fixes rdar://problem/32215763.
This commit is contained in:
Mark Lacey
2017-05-22 14:33:00 -07:00
parent 9520aff263
commit ceacfb4c53
5 changed files with 17 additions and 6 deletions

View File

@@ -6473,10 +6473,6 @@ Expr *ExprRewriter::convertLiteral(Expr *literal,
if (!argType)
return nullptr;
// If the argument type is in error, we're done.
if (argType->hasError())
return nullptr;
// Convert the literal to the non-builtin argument type via the
// builtin protocol, first.
// FIXME: Do we need an opened type here?