Skip to content

Commit be0bf46

Browse files
committed
[CSGen] Set correct ref kinds on synthesized makeIterator and next for for-in loops
1 parent 67ee63d commit be0bf46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Sema/CSGen.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4607,13 +4607,14 @@ generateForEachStmtConstraints(ConstraintSystem &cs, DeclContext *dc,
46074607
new (ctx) DeclRefExpr(makeIteratorVar, DeclNameLoc(stmt->getForLoc()),
46084608
/*Implicit=*/true),
46094609
nextId, labels);
4610-
nextRef->setFunctionRefKind(FunctionRefKind::Compound);
4610+
nextRef->setFunctionRefKind(FunctionRefKind::SingleApply);
46114611

46124612
ArgumentList *nextArgs;
46134613
if (nextFn && nextFn->getParameters()->size() == 1) {
46144614
auto isolationArg =
46154615
new (ctx) CurrentContextIsolationExpr(stmt->getForLoc(), Type());
4616-
nextArgs = ArgumentList::forImplicitUnlabeled(ctx, { isolationArg });
4616+
nextArgs = ArgumentList::createImplicit(
4617+
ctx, {Argument(SourceLoc(), ctx.Id_isolation, isolationArg)});
46174618
} else {
46184619
nextArgs = ArgumentList::createImplicit(ctx, {});
46194620
}

0 commit comments

Comments
 (0)