[Second review] SE-0390: Noncopyable structs and enums

One more short-term change we'd like to make to SE-0390 is to [remove the ability to declare deinit on enums] for the time being. As currently implemented, switch is a consuming operation on the value being switched, so an enum with a deinit would be of limited use, since taking apart a value with a deinit is not generally allowed without going through the deinit. When the proposal was first written, we were still hoping to also get borrow/inout bindings into the language at around the same time, which would have included the ability to switch on a value without consuming it. We can reintroduce the ability for enums to have deinits once that language functionality is in place.

10 Likes