<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 6, 2016, at 2:47 PM, Matthew Johnson <<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>> wrote:</div><br class="Apple-interchange-newline"></blockquote><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">This is not true. Public classes will *not* be “final by default”. It *will* be possible to subclass them within their declaring module. If they need to be final they will still need to be marked as such. </div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div></div></blockquote><div><blockquote type="cite" class=""><div class="">With that in mind, the your “can override” column (do you really mean “can subclass” here?) is also not correct. The correct answer is “yes, within the module”. The fundamental difference for this row is that there are some scopes which can *see* the type without the ability to subclass it. There is no problem with this, it is *exactly* what we want. </div></blockquote><div class=""><div class=""><br class=""></div></div></div><div>So would this be more accurate?</div><div><br class=""></div><div><div class=""><font face="SFMono-Regular" class=""> access | can access | can subclass/ | final</font></div><div class=""><font face="SFMono-Regular" class=""> | | override where |</font></div><div class=""><font face="SFMono-Regular" class=""> -------------+</font><span style="font-family: SFMono-Regular;" class="">---------------+</span><span style="font-family: SFMono-Regular;" class="">----------------+-------</span></div><div class=""><font face="SFMono-Regular" class=""> open | all scopes | all scopes | Error</font></div><div class=""><font face="SFMono-Regular" class=""> public | all scopes | within module | final</font></div><div class=""><font face="SFMono-Regular" class=""> internal | within module | within module | final</font></div><div class=""><font face="SFMono-Regular" class=""> fileprivate | within file | within file | final</font></div><div class=""><font face="SFMono-Regular" class=""> private | within scope | within scope | final</font></div><div class=""><br class=""></div></div><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">The purpose of this proposal is precisely to give library authors the ability to have more fine grained control over what capabilities their library exposes to users.</div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div></blockquote><div><br class=""></div><div>I don’t have an issue with the purpose, I have an issue with doing it by conflating access control and finality, and making the language confusing as a result.</div><div><br class=""></div><div>Assuming the above table matches your expectation, compare it with the same matrix for the language as it is today:</div><div><br class=""></div><div><div class=""><font face="SFMono-Regular" class=""> access | can access | can subclass/ | final</font></div><div class=""><font face="SFMono-Regular" class=""> | | override where |</font></div><div class=""><font face="SFMono-Regular" class=""> -------------+</font><span style="font-family: SFMono-Regular;" class="">---------------+</span><span style="font-family: SFMono-Regular;" class="">----------------+-------</span></div><div class=""><span style="font-family: SFMono-Regular;" class=""> public | all scopes | all scopes | final</span></div><div class=""><font face="SFMono-Regular" class=""> internal | within module | within module | final</font></div><div class=""><font face="SFMono-Regular" class=""> fileprivate | within file | within file | final</font></div><div class=""><font face="SFMono-Regular" class=""> private | within scope | within scope | final</font></div><div class=""><br class=""></div></div><div>The existing table is clean, it’s easy to understand; the two concepts are entirely separate from each other. The access control keyword defines where a class, method, property, or subscript can be accessed from; the `final` keyword defines whether or not it can be subclassed or overridden.</div><div><br class=""></div><div><br class=""></div><div>To give you an example of the confusion, here is code made perfectly legal by SE-0025:</div><div><br class=""></div><div> public final class Example {</div><div><br class=""></div><div> overridable func foo() {}</div><div><br class=""></div><div> }</div><div><br class=""></div><div>Scott</div></div></body></html>