You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
take and borrow parameter ownership modifiers (#1739)
* Michael's working draft from https://github.com/gottesmm/swift-evolution/blob/consuming-nonconsuming-pitch-v1/proposals/000b-consuming-nonconsuming.md
* New revision based on feedback from SE-0366
* Revisions in response to pitch discussion:
- Use `taking` and `borrowing func` modifiers to control `self`'s convention
- Add "alternative considered" for whether `take`n parameters should be bound
as mutable in the callee
* More additions from pitch discussion
- Mention that nonescaping closure arguments cannot be `take`-n
- Mention "out" parameter conventions as a future direction
- Include discussion of destructuring move-only values that normally would have destructors,
without invoking the normal deinit
* Remove "future direction" of destructuring methods
This fits better thematically as a future direction discussion with the `take` operator
proposal instead.
* Based on initial WG guidance, start off with suggesting that takes are locally mutable
* Clarify how witness matching works with move-only parameters: the ownership must match exactly
* Update and rename NNNN-parameter-ownership-modifiers.md to 0377-parameter-ownership-modifiers.md
Co-authored-by: Ben Cohen <[email protected]>
0 commit comments