iOS 17 Bug: Accessing @Dependency Inside Swift Task Groups Causes Silent Crash
Developers using Point-Free's swift-dependencies library on iOS 17 may encounter a fatal runtime crash when accessing @Dependency properties inside withTaskGroup or withThrowingTaskGroup closures. The crash stems from Swift's concurrency runtime restriction that forbids new task-local bindings while a task group is actively spawning child tasks. Because swift-dependencies resolves dependencies through Swift's task-local infrastructure, even a simple property read can trigger the fatal swift_task_reportIllegalTaskLocalBindingWithinWithTaskGroup error on iOS 17. The same code runs without issue on iOS 18 and later, making the bug easy to miss during development on modern devices. The recommended fix is to resolve all @Dependency values into local constants before entering the task group body.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in