[swift-evolution] Final by default for classes and methods

Felipe Cypriano felipe at cypriano.me
Wed Dec 23 14:28:18 CST 2015


On Wed, Dec 23, 2015, at 11:12, Felipe Cypriano wrote:
> About sealed vs final. I think this is a do or do not, sealed would
> just complicate things by having different behavior depending on where
> the code is. I'd go with final by default or not go at all.

I changed my mind about sealed being a bad thing, this email from [John
McCall]
(https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001032.html)
has very good points.

---

Also I just noticed that this thread title mentions methods as final by
default, but I can't find an example/proposal of how it would work. My
question is is anyone suggesting that methods must be marked as
"overridable" even if the class is inheritable? E.g:

``` open class Money {    func vanish() {    } } ```

Is `vanish` final?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151223/92b7a1d8/attachment.html>


More information about the swift-evolution mailing list