Avatar
Avatar
kntk
で、思ったんですが https://github.com/hborla/swift-evolution/blob/async-function-isolation/proposals/NNNN-async-function-isolation.md#task-isolation-inheritance によって nonisolatedが暗黙のisolated actor: (any Actor)? = #isolation を持つとしたときに
Task.initは特別ルールがあるらしく(現状のプロポーザルでは)、 Unstructured tasks created in nonisolated async functions do not capture the isolated parameter implicitly, and therefore do not inherit the isolation:
って仕様は https://github.com/sophiapoirier/swift-evolution/blob/closure-isolation/proposals/nnnn-closure-isolation-control.md#isolation-inheritance@inheritsIsolationの仕様とバッティングしませんか?@inheritsIsolationでもTaskだけさらに挙動を上書きするってことですかね
(edited)
@inheritsIsolationの仕様とバッティングしませんか?
だからどうにかしないとね、というコメントがありますねw
This area has some overlap with closure isolation control that will may have to be resolved. But, I'm confident we can figure that all out.
https://forums.swift.org/t/pitch-inherit-isolation-by-default-for-async-functions/74862/91 Task.initに関して同じ意見の方もいらっしゃいますね I just wish Task.init would always inherit isolation regardless of captured parameters and explicit syntax would allow developers to change that (e.g. Task.detached, closure isolation control, etc...). https://forums.swift.org/t/pitch-inherit-isolation-by-default-for-async-functions/74862/82
(edited)
😲 1