<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=""><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">I've been reading the discussion in "Final by default for classes and methods" and although I don't have a strong position towards what the default behaviour should be, I think a directive to change that behaviour should be added as when nullability was introduced into Obj-C.<div class=""><br class=""></div><div class="">In the current model of Swift, where methods and classes are not final we can ease that by doing something like this:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255);" class="">ASSUME_FINAL_BEGIN</div></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="color:rgb(4,51,255)" class="">class</span> MyClass {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <span style="color:rgb(4,51,255)" class="">func</span> aMethod(arg: <span style="color:rgb(52,149,175)" class="">String</span>) {</div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> }</div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> <span style="color:rgb(4,51,255)" class="">func</span> anotherMethod(number: <span style="color:rgb(52,149,175)" class="">Int</span>) {</div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255);" class="">ASSUME_FINAL_END</div></div></div></div></blockquote><br class="">I talked about this possibility in the thread you mention, and there are imho several other issues that could be addressed in a similar way:</div><div><span style="font-family: 'Helvetica Neue';" class="">[swift-evolution] [Pitch] make @noescape the default</span></div><div><span style="font-family: 'Helvetica Neue';" class="">[swift-evolution] Make non-void functions @warn_unused_result by default</span></div><br class=""><div class="">But there would be one big downside:</div><div class="">All this fruitless arguing about better defaults keeps amateurs like me busy — just imagine the havoc I'd cause in the complicated and important topics ;-)</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Tino</div></body></html>