@@ -1323,12 +1323,16 @@ struct PartitionOpEvaluator {
13231323 if (auto value = instance.maybeGetValue ()) {
13241324 if (auto *fArg = dyn_cast<SILFunctionArgument>(value)) {
13251325 if (fArg ->getArgumentConvention ().isIndirectOutParameter ()) {
1326+ auto staticRegionIsolation =
1327+ getIsolationRegionInfo (op.getOpArgs ()[1 ]);
13261328 Region srcRegion = p.getRegion (op.getOpArgs ()[1 ]);
13271329 auto dynamicRegionIsolation = getIsolationRegionInfo (srcRegion);
1330+
13281331 // We can unconditionally getValue here since we can never
13291332 // assign an actor introducing inst.
13301333 auto rep = getRepresentativeValue (op.getOpArgs ()[1 ]).getValue ();
1331- if (!dynamicRegionIsolation.isDisconnected ()) {
1334+ if (!dynamicRegionIsolation.isDisconnected () &&
1335+ !staticRegionIsolation.isUnsafeNonIsolated ()) {
13321336 handleError (AssignNeverSendableIntoSendingResultError (
13331337 op, op.getOpArgs ()[0 ], fArg , op.getOpArgs ()[1 ], rep,
13341338 dynamicRegionIsolation));
@@ -1451,12 +1455,15 @@ struct PartitionOpEvaluator {
14511455 if (auto value = instance.maybeGetValue ()) {
14521456 if (auto *fArg = dyn_cast<SILFunctionArgument>(value)) {
14531457 if (fArg ->getArgumentConvention ().isIndirectOutParameter ()) {
1458+ auto staticRegionIsolation =
1459+ getIsolationRegionInfo (op.getOpArgs ()[1 ]);
14541460 Region srcRegion = p.getRegion (op.getOpArgs ()[1 ]);
14551461 auto dynamicRegionIsolation = getIsolationRegionInfo (srcRegion);
14561462 // We can unconditionally getValue here since we can never
14571463 // assign an actor introducing inst.
14581464 auto rep = getRepresentativeValue (op.getOpArgs ()[1 ]).getValue ();
1459- if (!dynamicRegionIsolation.isDisconnected ()) {
1465+ if (!dynamicRegionIsolation.isDisconnected () &&
1466+ !staticRegionIsolation.isUnsafeNonIsolated ()) {
14601467 handleError (AssignNeverSendableIntoSendingResultError (
14611468 op, op.getOpArgs ()[0 ], fArg , op.getOpArgs ()[1 ], rep,
14621469 dynamicRegionIsolation));
0 commit comments