Factory: Requesting Is Not Resolving

A @MainActor Factory, a detached task, and a crash that compiles perfectly clean…

Factory: Requesting Is Not Resolving

A @MainActor Factory, a detached task, and a crash that compiles perfectly clean…

Michael Long
Michael Long in The Swift Cooperative
  ∙  
June 19, 2026
  ∙  
7 min read
Member-only content
  ∙  
View on Medium
Post image

Pretty much every article that touches Swift Concurrency tells you the same comforting thing about @MainActor. Slap it on the type, slap it on the property, and the compiler takes it from there. Cross an actor boundary the wrong way and you get a red squiggle, not a crash.

The whole point of the annotation specifically, and of modern Swift concurrency in general, is that these kinds of mistakes turn into errors at compile time.

And that’s mostly true.

Mostly.

But there’s a seam where that promise quietly stops being true, and a dependency injection container is exactly the sort…

Continue reading
This is a member-only story and can only be read on Medium.
Write on Medium
Sent to sikubaycom.s3cr3tz@blogger.com by Michael Long on Medium
Unsubscribe from this writer's email notifications
Manage your email settings

3500 South DuPont Highway, Suite IQ-101, Dover, DE 19901
Careers·Help Center·Privacy Policy·Terms of service