Skip to content

Commit ee7ccfd

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents 1e5908b + 16fdf88 commit ee7ccfd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,8 +3413,10 @@ IsImplicitlyUnwrappedOptionalRequest::evaluate(Evaluator &evaluator,
34133413
}
34143414

34153415
// If the parameter is not the 'newValue' parameter to a setter, it
3416-
// must be a subscript index parameter.
3417-
auto *subscript = cast<SubscriptDecl>(storage);
3416+
// must be a subscript index parameter (or we have an invalid AST).
3417+
auto *subscript = dyn_cast<SubscriptDecl>(storage);
3418+
if (!subscript)
3419+
return false;
34183420
auto *subscriptParams = subscript->getIndices();
34193421

34203422
auto where = llvm::find_if(*accessorParams,

0 commit comments

Comments
 (0)