[Pitch] `transferring` isolation regions of parameter and result values

If region of the value is not allowed to connect to actors (1) - that’s already how non-transferring parameters work. But they do this because region may be connected in the caller. So callee cannot know that connecting them to an actor is safe. The disconnected keyword maintenance the same restrictions for the caller, but now adds information that actually region is not connected. I don’t see how callee can make any use of this information. If this extra information is not helpful for the callee, then existing non-transferring params are sufficient to model this case.

In (2), if I understood you correctly, you are describing exactly what transferring does. After transferring to the actor region value is not accessible to the task-isolated code, but the test function is actor-isolated, so it may continue using the value. Once variable is reassigned a new value in disconnected region, it becomes accessible to the task-isolated code. And requirement to reassign the value before leaving the function comes from combination of transferring and inout.

actor MyActor {
  var ns = NonSendable()

  nonisolated func use1(_ x: NonSendable) async {}
  nonisolated func use2(_ x: NonSendable) {}
  func use3(_ x: NonSendanle) async {}

  func test(_ t: transferring inout NonSendable) async {
    // [(t), {self}]
    ns = t
    // [{t, self}]

    await use1(t) // error
    use2(t) // ok
    use3(t) // ok

    t = NonSendable()
    // [(t), {self}]
    await use1(t) // ok
    use2(t) // ok
    // [(t), {self}]
    use3(t) // ok
    // [{t, self}]
    await use1(t) // error

    t = NonSendable()
  }
}