Skip to content

Commit c5493d8

Browse files
committed
Move assert to CaptureListExpr::CaptureListExpr as suggested in review
1 parent 694c998 commit c5493d8

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

include/swift/AST/Expr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4270,6 +4270,7 @@ class CaptureListExpr final : public Expr,
42704270
AbstractClosureExpr *closureBody)
42714271
: Expr(ExprKind::CaptureList, /*Implicit=*/false, Type()),
42724272
closureBody(closureBody) {
4273+
assert(closureBody);
42734274
Bits.CaptureListExpr.NumCaptures = captureList.size();
42744275
std::uninitialized_copy(captureList.begin(), captureList.end(),
42754276
getTrailingObjects<CaptureListEntry>());

lib/IDE/Formatting.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,6 @@ class FormatWalker : public ASTWalker {
24852485
getIndentContextFrom(CaptureListExpr *CL,
24862486
SourceLoc ContextLoc = SourceLoc()) {
24872487
AbstractClosureExpr *CE = CL->getClosureBody();
2488-
assert(CE);
24892488
BraceStmt *BS = CE->getBody();
24902489
if (!BS)
24912490
return None;

0 commit comments

Comments
 (0)