@@ -1323,12 +1323,16 @@ struct PartitionOpEvaluator {
1323
1323
if (auto value = instance.maybeGetValue ()) {
1324
1324
if (auto *fArg = dyn_cast<SILFunctionArgument>(value)) {
1325
1325
if (fArg ->getArgumentConvention ().isIndirectOutParameter ()) {
1326
+ auto staticRegionIsolation =
1327
+ getIsolationRegionInfo (op.getOpArgs ()[1 ]);
1326
1328
Region srcRegion = p.getRegion (op.getOpArgs ()[1 ]);
1327
1329
auto dynamicRegionIsolation = getIsolationRegionInfo (srcRegion);
1330
+
1328
1331
// We can unconditionally getValue here since we can never
1329
1332
// assign an actor introducing inst.
1330
1333
auto rep = getRepresentativeValue (op.getOpArgs ()[1 ]).getValue ();
1331
- if (!dynamicRegionIsolation.isDisconnected ()) {
1334
+ if (!dynamicRegionIsolation.isDisconnected () &&
1335
+ !staticRegionIsolation.isUnsafeNonIsolated ()) {
1332
1336
handleError (AssignNeverSendableIntoSendingResultError (
1333
1337
op, op.getOpArgs ()[0 ], fArg , op.getOpArgs ()[1 ], rep,
1334
1338
dynamicRegionIsolation));
@@ -1451,12 +1455,15 @@ struct PartitionOpEvaluator {
1451
1455
if (auto value = instance.maybeGetValue ()) {
1452
1456
if (auto *fArg = dyn_cast<SILFunctionArgument>(value)) {
1453
1457
if (fArg ->getArgumentConvention ().isIndirectOutParameter ()) {
1458
+ auto staticRegionIsolation =
1459
+ getIsolationRegionInfo (op.getOpArgs ()[1 ]);
1454
1460
Region srcRegion = p.getRegion (op.getOpArgs ()[1 ]);
1455
1461
auto dynamicRegionIsolation = getIsolationRegionInfo (srcRegion);
1456
1462
// We can unconditionally getValue here since we can never
1457
1463
// assign an actor introducing inst.
1458
1464
auto rep = getRepresentativeValue (op.getOpArgs ()[1 ]).getValue ();
1459
- if (!dynamicRegionIsolation.isDisconnected ()) {
1465
+ if (!dynamicRegionIsolation.isDisconnected () &&
1466
+ !staticRegionIsolation.isUnsafeNonIsolated ()) {
1460
1467
handleError (AssignNeverSendableIntoSendingResultError (
1461
1468
op, op.getOpArgs ()[0 ], fArg , op.getOpArgs ()[1 ], rep,
1462
1469
dynamicRegionIsolation));
0 commit comments