swift-evolution/0366-move-function.md at main · apple/swift-evolution.
This maintains proposals for changes and user-visible enhancements to the Swift Programming Language. - swift-evolution/0366-move-function.md at main · apple/swift-evolution
Read in full here:
# `consume` operator to end the lifetime of a variable binding
* Proposal: [SE-0366](0366-move-function.md)
* Authors: [Michael Gottesman](https://github.com/gottesmm), [Andrew Trick](https://github.com/atrick), [Joe Groff](https://github.com/jckarter)
* Review Manager: [Holly Borla](https://github.com/hborla)
* Status: **Implemented (Swift 5.9)**
* Implementation: in main branch of compiler
* Review: ([pitch](https://forums.swift.org/t/pitch-move-function-use-after-move-diagnostic/53983)) ([first review](https://forums.swift.org/t/se-0366-move-function-use-after-move-diagnostic/59202)) ([returned for revision](https://forums.swift.org/t/returned-for-revision-se-0366-move-operation-use-after-move-diagnostic/59687)) ([second review](https://forums.swift.org/t/se-0366-second-review-take-operator-to-end-the-lifetime-of-a-variable-binding/61021)) ([third review](https://forums.swift.org/t/combined-se-0366-third-review-and-se-0377-second-review-rename-take-taking-to-consume-consuming/61904)), ([acceptance](https://forums.swift.org/t/accepted-se-0366-consume-operator-to-end-the-lifetime-of-a-variable-binding/62758))
* Previous Revisions:
* [1](https://github.com/apple/swift-evolution/blob/567fb1a66c784bcc5394491d24f72a3cb393674f/proposals/0366-move-function.md)
* [2](https://github.com/apple/swift-evolution/blob/43849aa9ae3e87c434866c5a5e389af67537ca26/proposals/0366-move-function.md)
* [3](https://github.com/apple/swift-evolution/blob/7af91127d693bffcb01aa87978d75d5a3170c4d1/proposals/0366-move-function.md)
## Introduction
In this document, we propose adding a new operator, marked by the
context-sensitive keyword `consume`, to the
language. `consume` ends the lifetime of a specific local `let`,
local `var`, or function parameter, and enforces this
by causing the compiler to emit a diagnostic upon any use after the
This file has been truncated. show original
This thread was posted by one of our members via one of our news source trackers.