[swift-evolution] Final by default for classes and methods
stephen.celis at gmail.com
Wed Dec 23 12:11:03 CST 2015
> On Dec 23, 2015, at 1:06 PM, Tino Heth <2th at gmx.de> wrote:
>>> "If I don't want to subclass something, I just don't do it — why do I have to change the properties of the superclass?"
>> Fix-its solve this with a single click.
> Really? I guess I like this alternate reality — can the Xcode in your universe refactor Swift sources as well? ;-)
Swift fix-its are proliferous.
- Mutate a `let` and Xcode will let you change it to a `var`
- Mutate in a struct's `get` and Xcode will let you change it to be `mutating`
- I imagine that with this change: inherit from default `final` and Xcode will let you change it to be `inheritable`
Generally, all the above are questionable to solve for you with a single click, but at least you have the option ;)
I like `sealed` at the very least. But I'd be happy (maybe prefer?) `final` by default.
More information about the swift-evolution