# \#isolated

**URL:** https://forums.swift.org/tag/isolated/847.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [Why can't I store this \`sending\` parameter in my mutex?](https://forums.swift.org/t/why-cant-i-store-this-sending-parameter-in-my-mutex/85449)

<div class="topic-metadata">

**Author:** [@jeremyabannister](https://forums.swift.org/u/jeremyabannister)\
**Replies:** 15\
**Last updated:** [April 3, 2026, 2:52am UTC](https://forums.swift.org/t/why-cant-i-store-this-sending-parameter-in-my-mutex/85449 "2026-04-03T02:52:06Z")

</div>

Can anyone shed some deeper light on why the following code doesn't compile? import Foundation import Synchronization final class A { let state = Mutex(State()) struct State { var callbacks: \[UUID:…

---

## [Isolated(any) evolution and current limitations](https://forums.swift.org/t/isolated-any-evolution-and-current-limitations/81923)

<div class="topic-metadata">

**Author:** [@SergeyPetrachkov](https://forums.swift.org/u/SergeyPetrachkov)\
**Replies:** 18\
**Last updated:** [November 17, 2025, 1:12am UTC](https://forums.swift.org/t/isolated-any-evolution-and-current-limitations/81923 "2025-11-17T01:12:44Z")

</div>

Hello there! I’m working as a platform engineer on a testing framework and i’m hitting some limitation with isolation and isolated(any). I’d like to give some examples and ask a few questions here. I have been using @i…

---

## [Closure ioslation and Actor](https://forums.swift.org/t/closure-ioslation-and-actor/82309)

<div class="topic-metadata">

**Author:** [@realmtai](https://forums.swift.org/u/realmtai)\
**Replies:** 1\
**Last updated:** [September 23, 2025, 2:18pm UTC](https://forums.swift.org/t/closure-ioslation-and-actor/82309 "2025-09-23T14:18:01Z")

</div>

Hello Folks, I have this code here. I'm getting the error, see screenshot. Assumptions: Is the code on line 11 running on the MainActor and Not the FactoryActor? even through the closure is invoked on line 22 in the …

---

## [Functions with both sending non-Sendable default parameter and isolation parameter cannot be called without passing argument to the non-Sendable parameter](https://forums.swift.org/t/functions-with-both-sending-non-sendable-default-parameter-and-isolation-parameter-cannot-be-called-without-passing-argument-to-the-non-sendable-parameter/81915)

<div class="topic-metadata">

**Author:** [@Serika\_PHB](https://forums.swift.org/u/Serika_PHB)\
**Replies:** 2\
**Last updated:** [September 10, 2025, 1:58am UTC](https://forums.swift.org/t/functions-with-both-sending-non-sendable-default-parameter-and-isolation-parameter-cannot-be-called-without-passing-argument-to-the-non-sendable-parameter/81915 "2025-09-10T01:58:00Z")

</div>

In the example below, the test function accept a sending non-Sendable parameter with a default value and an isolation parameter. When calling it, it is OK to pass an instance of NonSendable. However, if I call it without…

---

## [Inheritance of actor isolation for TaskGroup](https://forums.swift.org/t/inheritance-of-actor-isolation-for-taskgroup/81221)

<div class="topic-metadata">

**Author:** [@couchdeveloper](https://forums.swift.org/u/couchdeveloper)\
**Replies:** 8\
**Last updated:** [July 22, 2025, 8:03pm UTC](https://forums.swift.org/t/inheritance-of-actor-isolation-for-taskgroup/81221 "2025-07-22T20:03:32Z")

</div>

It seems, the rules for actor inheritance for Task closures and those added with addTask from a TaskGroup are not the same. I'm referring to the rules stated in SE-0420, specifically: According to SE-0304, closures pa…

---

## [Why no Data Race Warning with Task capturing isolated instance method?](https://forums.swift.org/t/why-no-data-race-warning-with-task-capturing-isolated-instance-method/80952)

<div class="topic-metadata">

**Author:** [@benallgeier](https://forums.swift.org/u/benallgeier)\
**Replies:** 5\
**Last updated:** [July 7, 2025, 7:57pm UTC](https://forums.swift.org/t/why-no-data-race-warning-with-task-capturing-isolated-instance-method/80952 "2025-07-07T19:57:31Z")

</div>

To avoid a Task capturing non-sendable self, one technique that can work is to capture just a sendable property of self in a task closure. In solving a slightly different problem, I was surprised to see that capturing a …

---

## [Swift 6.2 ready for isolated deinit?](https://forums.swift.org/t/swift-6-2-ready-for-isolated-deinit/80655)

<div class="topic-metadata">

**Author:** [@Fritzt](https://forums.swift.org/u/Fritzt)\
**Replies:** 5\
**Last updated:** [June 26, 2025, 9:05pm UTC](https://forums.swift.org/t/swift-6-2-ready-for-isolated-deinit/80655 "2025-06-26T21:05:39Z")

</div>

Shouldn’t the following code compile? However, I still encounter a runtime crash of the compiler in debug mode (Xcode 26 Beta 2). import UIKit class MyView: UIView { isolated deinit {} } This issue has also been rep…

---

## [Explicitly captured \`isolated\` parameter does not change isolation of \`@Sendable\`/\`sending\` closures](https://forums.swift.org/t/explicitly-captured-isolated-parameter-does-not-change-isolation-of-sendable-sending-closures/79502)

<div class="topic-metadata">

**Author:** [@NSFatalError](https://forums.swift.org/u/NSFatalError)\
**Replies:** 3\
**Last updated:** [April 25, 2025, 12:43pm UTC](https://forums.swift.org/t/explicitly-captured-isolated-parameter-does-not-change-isolation-of-sendable-sending-closures/79502 "2025-04-25T12:43:34Z")

</div>

Hi! I've came across an unexpected behavior when explicitly capturing an isolated parameter in TaskGroup.addTask closure and I'm trying to figure out whether this is intended behavior or a bug: actor MyActor {} func te…

---

## [Function called isolated on MainActor via an isolated parameter are not considered run on the MainActor](https://forums.swift.org/t/function-called-isolated-on-mainactor-via-an-isolated-parameter-are-not-considered-run-on-the-mainactor/71898)

<div class="topic-metadata">

**Author:** [@Frizlab](https://forums.swift.org/u/Frizlab)\
**Replies:** 6\
**Last updated:** [April 23, 2025, 7:01am UTC](https://forums.swift.org/t/function-called-isolated-on-mainactor-via-an-isolated-parameter-are-not-considered-run-on-the-mainactor/71898 "2025-04-23T07:01:06Z")

</div>

If I try to compile the following, I get a compilation error: import Foundation func isolatedPrint\<A : Actor\>(on actor: isolated A) { print("hello") } Task{ @MainActor in isolatedPrint(on: MainActor.shared) } T…

---

## [Region based isolation prevents sending a Sendable type](https://forums.swift.org/t/region-based-isolation-prevents-sending-a-sendable-type/75931)

<div class="topic-metadata">

**Author:** [@jeremyabannister](https://forums.swift.org/u/jeremyabannister)\
**Replies:** 3\
**Last updated:** [November 10, 2024, 1:06pm UTC](https://forums.swift.org/t/region-based-isolation-prevents-sending-a-sendable-type/75931 "2024-11-10T13:06:06Z")

</div>

The following code fails to compile: final class NonSendable { let mainActorIsolated: MainActorIsolated init(mainActorIsolated: MainActorIsolated) { self.mainActorIsolated = mainActorIsolated …

---

## [Enum default value isolation](https://forums.swift.org/t/enum-default-value-isolation/75014)

<div class="topic-metadata">

**Author:** [@stardustWK](https://forums.swift.org/u/stardustWK)\
**Replies:** 0\
**Last updated:** [September 29, 2024, 9:48am UTC](https://forums.swift.org/t/enum-default-value-isolation/75014 "2024-09-29T09:48:33Z")

</div>

I have read SE-0411 Isolated default value expressions @MainActor public struct TextConfig { public init(title: String = "") { self.title = title } var title: String } @MainActor struct BarItemConfi…

---

## [Swift 6 Key path compiler bug or human misunderstanding?](https://forums.swift.org/t/swift-6-key-path-compiler-bug-or-human-misunderstanding/73591)

<div class="topic-metadata">

**Author:** [@Fritzt](https://forums.swift.org/u/Fritzt)\
**Replies:** 7\
**Last updated:** [August 23, 2024, 9:20am UTC](https://forums.swift.org/t/swift-6-key-path-compiler-bug-or-human-misunderstanding/73591 "2024-08-23T09:20:12Z")

</div>

I'm trying to understand a key path error when porting an app to Swift 6 language mode using Xcode 16 beta 4. The error from the compiler is: error: cannot form key path to main actor-isolated property 'rebuildDatabase…

---

## [Where to order #isolation and #\_sourceLocation arguments](https://forums.swift.org/t/where-to-order-isolation-and-sourcelocation-arguments/74070)

<div class="topic-metadata">

**Author:** [@macguru](https://forums.swift.org/u/macguru)\
**Replies:** 14\
**Last updated:** [August 22, 2024, 10:09am UTC](https://forums.swift.org/t/where-to-order-isolation-and-sourcelocation-arguments/74070 "2024-08-22T10:09:24Z")

</div>

I have a test function implemented, basically an extension to Swift Testing's await confirmation {…} function. In order to get good error messages on the call site, I pass a SourceLocation to test assertions inside. In o…

---

## [Swift 6 (from Xcode 16b5), overridden function and isolation](https://forums.swift.org/t/swift-6-from-xcode-16b5-overridden-function-and-isolation/73862)

<div class="topic-metadata">

**Author:** [@andyj-at-aspin](https://forums.swift.org/u/andyj-at-aspin)\
**Replies:** 2\
**Last updated:** [August 9, 2024, 8:37pm UTC](https://forums.swift.org/t/swift-6-from-xcode-16b5-overridden-function-and-isolation/73862 "2024-08-09T20:37:19Z")

</div>

Has the isolation of override functions been changed with the latest beta release? The following two code snippets produce 1 failure to compile and 2 warnings. Earlier beta's had no issue with either snippet: import Fou…

---

## [Why this kind of isolation pattern is allowed?](https://forums.swift.org/t/why-this-kind-of-isolation-pattern-is-allowed/73238)

<div class="topic-metadata">

**Author:** [@NeonTetra](https://forums.swift.org/u/NeonTetra)\
**Replies:** 1\
**Last updated:** [July 31, 2024, 6:59am UTC](https://forums.swift.org/t/why-this-kind-of-isolation-pattern-is-allowed/73238 "2024-07-31T06:59:46Z")

</div>

This code is compiled and have no warning. even though State is shared between different actor which is unSendable and even not makred as sending. func bar(isolation actor: isolated any Actor = #isolation) async { …

---

## [Confused with actor isolation with ThrowingTaskGroup in Swift 6](https://forums.swift.org/t/confused-with-actor-isolation-with-throwingtaskgroup-in-swift-6/72540)

<div class="topic-metadata">

**Author:** [@NeonTetra](https://forums.swift.org/u/NeonTetra)\
**Replies:** 2\
**Last updated:** [June 19, 2024, 12:22pm UTC](https://forums.swift.org/t/confused-with-actor-isolation-with-throwingtaskgroup-in-swift-6/72540 "2024-06-19T12:22:33Z")

</div>

I'm trying to simulate DiscardingThrowingTaskgGroup using ThrowingTaskgGroup and actor isolation. And I end up with Concurrency Compiler error that looks odd to me. This code does compile and ThrowingTaskGroup is prote…

---

## [Overloading on the isolation of a closure parameter](https://forums.swift.org/t/overloading-on-the-isolation-of-a-closure-parameter/72476)

<div class="topic-metadata">

**Author:** [@jeremyabannister](https://forums.swift.org/u/jeremyabannister)\
**Replies:** 5\
**Last updated:** [June 17, 2024, 1:25pm UTC](https://forums.swift.org/t/overloading-on-the-isolation-of-a-closure-parameter/72476 "2024-06-17T13:25:10Z")

</div>

Here's the code that I perhaps naively attempted to write: public func expectError( from closure: ()async throws-\>() ) async throws { do { try await closure() throw "ExpectedErrorButGotNone"…
