Hello, Swift community.
The second review of SE-0390 ran from March 21st through April 4th. The second review was narrowly focused on the revisions made after the first review:
- The spelling of the "negative constraint"
~Copyable
. - The spelling of the
discard self
operator and its constraints.
There was a lot of discussion about how to spell the negative constraint; there was a lot of discussion within the language workgroup as well. Ultimately, we felt that none of the offered alternatives were clearly better, so we went with what was in the proposal text. The spelling is ~Copyable
.
There are three minor changes to the proposal that the workgroup agreed to make doing our discussion:
-
At the very end of the review, it was noted by one of the proposal authors that there would be no easy way to suppress an unused variable warning with
_ = x
orlet _ = x
whenx
is a noncopyable binding, if those assignments were consuming. The workgroup agreed to adopt the rule that assignment to_
will be interpreted as a borrowing, rather than consuming operation. If you want to end the lifetime, that can be written with_ = consume x
. -
Noncopyable enums cannot have a
deinit
. -
When switching over a noncopyable type, you must
switch consume self
.
The latter two might be relaxed via future proposals; they are pragmatic considerations more than fundamental design requirements.
SE-0390 has been accepted with the above modifications. The proposal text will be updated to include them.
Thanks to both the community and the proposal authors for their patience.
Steve Canon
Review Manager