Skip to content

Commit 61fbaa7

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.
1 parent cf3dab1 commit 61fbaa7

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
@@ -3460,19 +3460,6 @@ namespace {
34603460
}
34613461
}
34623462

3463-
// The constraint solver may not have chosen legal casts.
3464-
if (auto funcConv = dyn_cast<FunctionConversionExpr>(expr)) {
3465-
checkFunctionConversion(funcConv,
3466-
funcConv->getSubExpr()->getType(),
3467-
funcConv->getType());
3468-
}
3469-
3470-
if (auto *isolationErasure = dyn_cast<ActorIsolationErasureExpr>(expr)) {
3471-
checkFunctionConversion(isolationErasure,
3472-
isolationErasure->getSubExpr()->getType(),
3473-
isolationErasure->getType());
3474-
}
3475-
34763463
if (auto *defaultArg = dyn_cast<DefaultArgumentExpr>(expr)) {
34773464
checkDefaultArgument(defaultArg);
34783465
}
@@ -3564,6 +3551,19 @@ namespace {
35643551
}
35653552
}
35663553

3554+
// The constraint solver may not have chosen legal casts.
3555+
if (auto funcConv = dyn_cast<FunctionConversionExpr>(expr)) {
3556+
checkFunctionConversion(funcConv,
3557+
funcConv->getSubExpr()->getType(),
3558+
funcConv->getType());
3559+
}
3560+
3561+
if (auto *isolationErasure = dyn_cast<ActorIsolationErasureExpr>(expr)) {
3562+
checkFunctionConversion(isolationErasure,
3563+
isolationErasure->getSubExpr()->getType(),
3564+
isolationErasure->getType());
3565+
}
3566+
35673567
return Action::Continue(expr);
35683568
}
35693569

0 commit comments

Comments
 (0)