Avatar
すいませんXでも書いたんですけど、Region based IsolationのFuture directionになんかあったなーくらいな認識しかまだしてなかったので、後でPRちゃんと読んでみますmm ざっくりと異なる分離領域で使われなくするために必要としかまだ理解できていないです。なんとなくconsumingみたいな感じなのかと。。。 actor Actor { func method(_ x: transferring NonSendable, _ y : NonSendable, _ z : NonSendable) async { // Regions: [(x), {(y, z), self}] // Safe to transfer x since x is marked as transferring. await transferToMainActor(x) } } actor Actor { func transfer<T>(_ t: transferring T) async {} func method() async { let a = NonSendable() // Pass a into transfer. Even though we are in the same // isolation domain as transfer... await transfer(a) // Since we transferred a, we are no longer allowed to use a here. Error! useValue(a) } } https://github.com/apple/swift-evolution/blob/main/proposals/0414-region-based-isolation.md#transferring-parameters (edited)
This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - apple/swift-evolution