When failing to find a suitable type witness, always record ErrorType.

Fixes the crash in rdar://problem/20564378. In these cases, we end up
swallowing some diagnostics. That will be addressed in a subsequent
commit.

Swift SVN r27436
This commit is contained in:
Doug Gregor
2015-04-17 18:11:35 +00:00
parent 266abbded1
commit 69718f77fa
5 changed files with 181 additions and 6 deletions

View File

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