Index optional is pattern

This commit is contained in:
Bruno Rocha
2018-11-01 09:56:00 -03:00
committed by Robert Widmann
parent d9d6457177
commit 4d85c8bcd1
2 changed files with 19 additions and 1 deletions

View File

@@ -3179,7 +3179,7 @@ namespace {
castKind == CheckedCastKind::SetDowncast) {
auto toOptType = OptionalType::get(toType);
ConditionalCheckedCastExpr *cast = new (ctx) ConditionalCheckedCastExpr(
sub, expr->getLoc(), SourceLoc(), TypeLoc::withoutLoc(toType));
sub, expr->getLoc(), SourceLoc(), expr->getCastTypeLoc());
cs.setType(cast, toOptType);
cs.setType(cast->getCastTypeLoc(), toType);
if (expr->isImplicit())