swift
c34795ee - [Concurrency] Diagnose captures of `self` in a task created in deinit.

Commit
1 year ago
[Concurrency] Diagnose captures of `self` in a task created in deinit. This is done by diagnosing captures of `self` in escaping `sending` or `@Sendable` closures inside a deinit, which almost certainly means `self` will outlive deinit at runtime, which is a fatal error. This is a common mistake to make when creating isolated tasks inside nonisolated deinits to workaround the lack of synchrnous isolated deinits in Swift 6. (cherry picked from commit 18b747c1815f5c82026b6c6e3a84a4b103fb74c5)
Author
Committer
Parents
Loading