# \#actor

**URL:** https://forums.swift.org/tag/actor/1020.md

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

---

## [Allow closure to be statically isolated to a weakly captured actor](https://forums.swift.org/t/allow-closure-to-be-statically-isolated-to-a-weakly-captured-actor/85451)

<div class="topic-metadata">

**Author:** [@jeremyabannister](https://forums.swift.org/u/jeremyabannister)\
**Replies:** 15\
**Last updated:** [March 25, 2026, 12:40am UTC](https://forums.swift.org/t/allow-closure-to-be-statically-isolated-to-a-weakly-captured-actor/85451 "2026-03-25T00:40:53Z")

</div>

Right now, you can write an API that allows an actor to call it and pass in a closure that is statically isolated to the calling actor: final class Foo { func onWrite(\_ callback: @escaping () async -\> ()) { …

---

## [Actor seems not work with ExpressibleByIntegerLiteral](https://forums.swift.org/t/actor-seems-not-work-with-expressiblebyintegerliteral/84902)

<div class="topic-metadata">

**Author:** [@frogcjn](https://forums.swift.org/u/frogcjn)\
**Replies:** 25\
**Last updated:** [March 3, 2026, 10:59pm UTC](https://forums.swift.org/t/actor-seems-not-work-with-expressiblebyintegerliteral/84902 "2026-03-03T22:59:49Z")

</div>

actor BetterInt: ExpressibleByIntegerLiteral { private(set) var value: Int = 0 init(integerLiteral value: Int) { self.value = value } } will report error on init: Non-Sendable parameter type 'Self.I…

---

## [Finding a way to allow this in-reality-safe isolation violation](https://forums.swift.org/t/finding-a-way-to-allow-this-in-reality-safe-isolation-violation/82145)

<div class="topic-metadata">

**Author:** [@jeremyabannister](https://forums.swift.org/u/jeremyabannister)\
**Replies:** 12\
**Last updated:** [September 22, 2025, 11:51pm UTC](https://forums.swift.org/t/finding-a-way-to-allow-this-in-reality-safe-isolation-violation/82145 "2025-09-22T23:51:31Z")

</div>

Currently (in Swift 6.2) the following code does not compile: actor Foo { let bar: Bar init() { self.bar = .init(constant: 7) } nonisolated var constant: Int { bar.constant // E…

---

## [@isolated(any) isolation property is nil for non global actor isolation](https://forums.swift.org/t/isolated-any-isolation-property-is-nil-for-non-global-actor-isolation/79310)

<div class="topic-metadata">

**Author:** [@MuniekMg](https://forums.swift.org/u/MuniekMg)\
**Replies:** 11\
**Last updated:** [August 5, 2025, 2:44am UTC](https://forums.swift.org/t/isolated-any-isolation-property-is-nil-for-non-global-actor-isolation/79310 "2025-08-05T02:44:19Z")

</div>

Hi, I'm experimenting with the @isolated(any) attribute on functions introduced in SE-0431. If I understand it correctly, closures annotated with @isolated(any) should carry isolation (Actor reference) from the context …

---

## [Mutation of captured a var in concurrently-executing code, racing, how?](https://forums.swift.org/t/mutation-of-captured-a-var-in-concurrently-executing-code-racing-how/81127)

<div class="topic-metadata">

**Author:** [@realmtai](https://forums.swift.org/u/realmtai)\
**Replies:** 11\
**Last updated:** [July 16, 2025, 5:04pm UTC](https://forums.swift.org/t/mutation-of-captured-a-var-in-concurrently-executing-code-racing-how/81127 "2025-07-16T17:04:02Z")

</div>

Hello everyone, I got an error/warning of 'Mutation of captured a var in concurrently-executing code.' How does the compiler see the race condition happen? Maybe there's a fundamental misunderstanding of how Task works …

---

## ["Incorrect actor executor assumption" run-time error in Swift 6 mode](https://forums.swift.org/t/incorrect-actor-executor-assumption-run-time-error-in-swift-6-mode/74870)

<div class="topic-metadata">

**Author:** [@crontab](https://forums.swift.org/u/crontab)\
**Replies:** 4\
**Last updated:** [March 15, 2025, 11:03am UTC](https://forums.swift.org/t/incorrect-actor-executor-assumption-run-time-error-in-swift-6-mode/74870 "2025-03-15T11:03:24Z")

</div>

I have encountered a pretty strange run-time error in Swift 6 mode with the following code: protocol P { var key: String { get } } @globalActor actor GA { static var shared = GA() } @GA class A: P { let key: String…

---

## [CoreData inside of Actor](https://forums.swift.org/t/coredata-inside-of-actor/78419)

<div class="topic-metadata">

**Author:** [@BitByAVampire](https://forums.swift.org/u/BitByAVampire)\
**Replies:** 1\
**Last updated:** [March 10, 2025, 9:43pm UTC](https://forums.swift.org/t/coredata-inside-of-actor/78419 "2025-03-10T21:43:56Z")

</div>

Im seeing some crashes due to concurrent accesses to CoreData, even though its inside of an Actor. Is there any issue with CoreData using the Actor? (i know actor uses a queue like com.apple.root.user-initiated-qos.coop…

---

## [Why \`nonisolated lazy var\` is allowed on actor?](https://forums.swift.org/t/why-nonisolated-lazy-var-is-allowed-on-actor/74609)

<div class="topic-metadata">

**Author:** [@belyakov\_e](https://forums.swift.org/u/belyakov_e)\
**Replies:** 6\
**Last updated:** [March 7, 2025, 10:13am UTC](https://forums.swift.org/t/why-nonisolated-lazy-var-is-allowed-on-actor/74609 "2025-03-07T10:13:55Z")

</div>

If trying to make var declared on actor nonisolated, Swift 6 compiler of course produces error: "'nonisolated' cannot be applied to mutable stored properties". That is clear because such declaration would create shared…

---

## [What is the correct way to call UIApplication.shared.beginBackgroundTask no on the main thread?](https://forums.swift.org/t/what-is-the-correct-way-to-call-uiapplication-shared-beginbackgroundtask-no-on-the-main-thread/75196)

<div class="topic-metadata">

**Author:** [@nomnom](https://forums.swift.org/u/nomnom)\
**Replies:** 5\
**Last updated:** [October 11, 2024, 3:52pm UTC](https://forums.swift.org/t/what-is-the-correct-way-to-call-uiapplication-shared-beginbackgroundtask-no-on-the-main-thread/75196 "2024-10-11T15:52:51Z")

</div>

This is my newbie implementation for beginBackgroundTask @MainActor class BackgroundTaskManager { var backgroundTaskID: UIBackgroundTaskIdentifier = .invalid func startBackgroundTask() { backgroundTas…

---

## [Actor \`assumeIsolated\` erroneously crashes when using a dispatch queue as the underlying executor](https://forums.swift.org/t/actor-assumeisolated-erroneously-crashes-when-using-a-dispatch-queue-as-the-underlying-executor/72434)

<div class="topic-metadata">

**Author:** [@wadetregaskis](https://forums.swift.org/u/wadetregaskis)\
**Replies:** 20\
**Last updated:** [August 16, 2024, 10:13am UTC](https://forums.swift.org/t/actor-assumeisolated-erroneously-crashes-when-using-a-dispatch-queue-as-the-underlying-executor/72434 "2024-08-16T10:13:59Z")

</div>

import Dispatch actor Example { final class DispatchQueueExecutor: SerialExecutor { private let queue: DispatchQueue init(queue: DispatchQueue) { self.queue = queue } fu…

---

## [Why No Data Race Warning in the non-isolated async function with non-sendable Type?](https://forums.swift.org/t/why-no-data-race-warning-in-the-non-isolated-async-function-with-non-sendable-type/72941)

<div class="topic-metadata">

**Author:** [@yudonlee](https://forums.swift.org/u/yudonlee)\
**Replies:** 10\
**Last updated:** [July 10, 2024, 3:11pm UTC](https://forums.swift.org/t/why-no-data-race-warning-in-the-non-isolated-async-function-with-non-sendable-type/72941 "2024-07-10T15:11:30Z")

</div>

public class StockExampleSite { private let korea: Korea init(korea: Korea) { self.korea = korea } internal func kospi() async -\> Double { // Warning because of passing non-sendable typ…
