> On Dec 23, 2015, at 12:43 PM, Craig Cruden <ccru...@novafore.com> wrote:
> 
> I thought sealed and final were effectively the same thing for production 
> code, which is why it confuses me when you say final is right anything less 
> including sealed is not.
> 
> In Scala at least sealed is final with the exception that subclasses within 
> the same source file are allowed.  When it is compiled and shipped - you can 
> no longer modify that source file….. 

They are not at all the same.  The difference is that with sealed you cannot 
inherit from classes in other modules which are not explicitly marked 
`inheritable`, but you can inherit from classes in your own module that are not 
explicitly marked `inheritable`.  That is a big difference.

> 
> 
>> On 2015-12-24, at 1:36:01, Matthew Johnson via swift-evolution 
>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
>> 
>> I strongly feel that I shouldn’t pay a price in production code in order to 
>> better support those use cases.  IMO ‘final’ is the right default for 
>> production code and we pay a price if the default is anything less, 
>> including ‘sealed’. 
> 

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to