<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 Feb 25, 2016, at 1:23 PM, Jean-Daniel Dupas <<a href="mailto:mailing@xenonium.com" class="">mailing@xenonium.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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="Apple-interchange-newline">Le 25 févr. 2016 à 20:19, Matthew Johnson via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :<br class=""><br class=""><br class=""><br class="">Sent from my iPad<br class=""><br class=""><blockquote type="cite" class="">On Feb 25, 2016, at 1:17 PM, Jean-Daniel Dupas via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""><br class=""><blockquote type="cite" class="">Le 25 févr. 2016 à 16:47, Jeremy Pereira via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :<br class=""><br class=""><br class=""><blockquote type="cite" class="">On 17 Feb 2016, at 22:26, Kyle Sherman via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">Thanks for the replies.<br class=""><br class="">Kenny: After thinking about it more, discussing with Peter, and looking Haravikk’s comments, I think the best thing would be for this to be a warning as suggested. I respectfully disagree that as a library creator you would not be able to know that a call to super should be required.<br class=""></blockquote><br class="">I disagree. You can’t possibly know all the use-cases in which your class might be subclassed.<span class="Apple-converted-space"> </span><br class=""><br class="">In particular, it is absurd to enforce having the call to super as the first or last line of the method. That would stop me doing things like this:<br class=""><br class="">override func viewDidLoad()<br class="">{<br class=""> print(“About to run super.viewDidLoad()”)<br class=""> super.viewDidLoad()<br class=""> print(“Finished super.viewDidLoad()”)<br class="">}<br class=""><br class="">Then there’s the perfectly reasonable case like this:<br class=""><br class="">override func viewDidLoad()<br class="">{<br class=""> functionThatCallsSuperViewDidLoad()<br class="">}<br class=""><br class="">Why shouldn’t I be allowed to do that?<br class=""></blockquote><br class="">+1 with your concern. I’d be curious to see a single real world use case where enforcing first or last is required.<br class=""></blockquote><br class="">I posted several examples from Apple frameworks in an old thread about this. You might want to look for that message in the archives.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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; float: none; display: inline !important;" class="">And not a single one has a strong requirement about prohibiting code to be call before or after the super class implementation.</span></div></blockquote><br class=""></div><div>It depends what you mean by “strong”. Sure, a log statement won’t make much difference. But the examples I gave do have semantic requirements that super should either go first or last in performing real work to be done by the method.</div><br class=""></body></html>