[swift-evolution] Final by default for classes and methods
Matthew Johnson
matthew at anandabits.com
Wed Dec 23 14:37:36 CST 2015
Sent from my iPhone
> On Dec 23, 2015, at 2:28 PM, Felipe Cypriano via swift-evolution <swift-evolution at swift.org> wrote:
>
>> 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:
The original post did indeed have that intention. However, pretty much the entire thread has been focused exclusively on classes, not methods. That has turned out to be a plenty big can of worms on its own.
I think it's best to keep this thread focused on classes. We can start a new thread for methods later if desired. But we should wait until the dust has settled on the classes conversation IMO.
>
> ```
> open class Money {
> func vanish() {
> }
> }
> ```
>
> Is `vanish` final?
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151223/61ccb238/attachment.html>
More information about the swift-evolution
mailing list