@@ -3493,8 +3493,6 @@ static BraceStmt *desugarForEachStmt(ForEachStmt* stmt){
34933493 Expr *makeIteratorCall =
34943494 CallExpr::createImplicitEmpty (ctx, makeIteratorRef);
34953495
3496- // FIXME: commenting this out "fixes" a redundant visit of the sequence's init
3497- // expr. We need to investigate this.
34983496 // Swap in the 'unsafe' expression.
34993497 if (unsafeExpr) {
35003498 unsafeExpr = UnsafeExpr::createImplicit (ctx, unsafeExpr->getUnsafeLoc (), makeIteratorCall);
@@ -3596,31 +3594,10 @@ static BraceStmt *desugarForEachStmt(ForEachStmt* stmt){
35963594 nullptr , /* implicit*/ true , ctx);
35973595 }
35983596
3597+ // FIXME: do we need to do anything extra here or elseswhere if the for each
3598+ // stmt is async?
35993599 auto * whileStmt = new (ctx) WhileStmt (stmt->getLabelInfo (), SourceLoc (), ctx.AllocateCopy (cond), whileBody, true );
36003600
3601- /*
3602- // IF BORROWING:
3603- // condition is an array of StmtConditionElements
3604- // We want to reuse the pattern for the for loop
3605- // the borrow $x
3606- // Contextual Type of the pattern can be used to
3607- // case let = BindingPattern used for ConditionalPatternBindingInfo
3608- // BindingPattern + NamedPattern = condition
3609- SmallVector<StmtConditionElement, 2> Cond;
3610- auto spanVar = new (ctx) VarDecl(false,
3611- VarDecl::Introducer::Let,
3612- SourceLoc()
3613- , ctx.getIdentifier("span")
3614- , nullptr);
3615- spanVar->setImplicit();
3616- // FIXME: rename variable
3617- // Why do we need things to be Implicit? Do we even?
3618- auto *spanVarPattern= NamedPattern::createImplicit(ctx, spanVar, nextCall->getType());
3619- auto *let =
3620- BindingPattern::createImplicit(ctx, VarDecl::Introducer::Let, spanVarPattern);
3621- Cond.emplace_back(let);
3622- auto spanIsEmptyExpr = new (ctx) Expr();*/
3623-
36243601 SmallVector<ASTNode, 2 > stmts;
36253602 stmts.push_back (PB);
36263603 stmts.push_back (whileStmt);
0 commit comments