Avatar
↓が何を言ってるのか理解するのにめっちゃ苦労したけど、コードは大して難しくない。単に detach のクロージャ式の中が non-isolated だから await 必須だよと。
A task created with detach runs concurrently with all other code. If the closure passed to detach were to be actor-isolated, we would introduce a data race on access to the mutable state on BankAccount. Actors prevent this data race by specifying that a @Sendable closure ... is always non-isolated.