Skip to content

Commit 4699419

Browse files
committed
[Concurrency] Check function conversions after their sub-expressions have been checked
Explicit closure expressions gets their isolation inferred during actor isolation checking, if they appear as a sub-expression to a function conversion we need to delay function checking until the closure was processed. It shouldn't matter for other cases. (cherry picked from commit 61fbaa7)
1 parent 641cfe0 commit 4699419

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3477,19 +3477,6 @@ namespace {
34773477
}
34783478
}
34793479

3480-
// The constraint solver may not have chosen legal casts.
3481-
if (auto funcConv = dyn_cast<FunctionConversionExpr>(expr)) {
3482-
checkFunctionConversion(funcConv,
3483-
funcConv->getSubExpr()->getType(),
3484-
funcConv->getType());
3485-
}
3486-
3487-
if (auto *isolationErasure = dyn_cast<ActorIsolationErasureExpr>(expr)) {
3488-
checkFunctionConversion(isolationErasure,
3489-
isolationErasure->getSubExpr()->getType(),
3490-
isolationErasure->getType());
3491-
}
3492-
34933480
if (auto *defaultArg = dyn_cast<DefaultArgumentExpr>(expr)) {
34943481
checkDefaultArgument(defaultArg);
34953482
}
@@ -3581,6 +3568,19 @@ namespace {
35813568
}
35823569
}
35833570

3571+
// The constraint solver may not have chosen legal casts.
3572+
if (auto funcConv = dyn_cast<FunctionConversionExpr>(expr)) {
3573+
checkFunctionConversion(funcConv,
3574+
funcConv->getSubExpr()->getType(),
3575+
funcConv->getType());
3576+
}
3577+
3578+
if (auto *isolationErasure = dyn_cast<ActorIsolationErasureExpr>(expr)) {
3579+
checkFunctionConversion(isolationErasure,
3580+
isolationErasure->getSubExpr()->getType(),
3581+
isolationErasure->getType());
3582+
}
3583+
35843584
return Action::Continue(expr);
35853585
}
35863586

0 commit comments

Comments
 (0)