<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Or simply make `throws` and `requires_super` mutually exclusive?</div><div class=""><br class=""></div><div class="">The case where the base class does not `throw` but the subclass `throws` isn't possible</div><div class="">as it would break all clients who cast everything to the base class and assume that it doesn't throw.</div><div class=""><br class=""></div><div class="">Etan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On 16 Dec 2015, at 17:46, Marc Knaup via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" 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="">+1 always had such issues with UIViewController's lifecycle methods.<div class=""><br class=""></div><div class="">But edge cases need to be considered like "throws" for example.</div><div class="">Do I need to call super before I throw something?</div></div><div class="gmail_extra" 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;"><br class=""><div class="gmail_quote">On Wed, Dec 16, 2015 at 5:41 PM, Matthew Johnson via swift-evolution<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class="">+1 to this.&nbsp; Anything that helps ensure inheritance is thought through carefully and used correctly is a win.<div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On Dec 16, 2015, at 10:32 AM, Vester Gottfried via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5"><div dir="ltr" class=""><div class="">Some class based libraries/frameworks expect the consumer to subclass certain classes and override specific method and require that the super implementation of an overridden method is being called.</div><div class=""><br class=""></div><div class="">Not calling the super implementation is a common source of bugs that may be prevented if the compiler checks if super is called, like it does in some cases of init().</div><div class=""><br class=""></div><div class="">Example:<br class=""></div><div class=""><br class=""></div><div class="">class Box {</div><div class="">&nbsp; &nbsp;@requires_super<br class=""></div><div class="">&nbsp; &nbsp; func addStuff() { ... }</div><div class="">}<br class=""></div><div class=""><br class=""></div><div class="">Overriding class&nbsp;Box's addStuff without calling super.addStuff() should result in an error</div><div class=""><br class=""></div><div class="">class Chest :&nbsp;Box {</div><div class="">&nbsp; &nbsp; override addStuff() {<br class=""></div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// ERROR: addStuff() requires call to super.addStuff()</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; ...</div><div class="">&nbsp; &nbsp; }</div><div class="">}<br class=""></div><div class=""><br class=""></div><div class="">Objective-C developers know this as NS_REQUIRES_SUPER and I think its worth thinking about adapting it.</div><div class=""><div class=""><br class=""></div><div class="">I hope my proposal was clear and thanks for reading,</div><div class=""><br class=""></div></div><div class="">Gottfried</div></div></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=eLFMrKDT8iBxZ-2Fbnk-2BZqvSchNN-2FvYXdceA0T7VxwkAfetdXVtelgzCfab-2Fp92fvLNUbxvC5Ukh9mTRYtT7oZ-2BzUDHQ-2FkLVfwWHuXGWvz7iaXCPo1KAcjPGxoZUQTW8DMleErzJnIt-2FRMb1-2FEM1WN-2BscY0xmKk-2BmXO16SS-2BCT9-2B7dgbk1nlmgpvH5cNha2dTvKe3-2FSntENn88F21K4ayGJlZuPediCmd1qI2SGJLz5ZQ-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=6ZGE61OxINd5lLe2xYh9Ku-2BXbixWNr2nvfzp2IB1sZh6TKQF8BMklGkmbYn3aAkB6MJpxZ0t4CiiE4yQ7c3-2F-2FxDq-2BE2nhnHvAuBkVBkwM6uDXj3Tn9ItDh6xxQ-2FkLlwiu1hYr6F53gyOSlV8vvG2QFLbE8T144o6I89KhIacPLr89IyBgLNJrrpOeDUJRbKLXLQQTW2cBkYK87e4-2B4ZzjRVbIK6-2FolcNdTCYIDUgxlA-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""></div><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><br class=""></blockquote></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=tTTJ5sn5y0uc3ODSZa-2BndLNwXCDS7T2cq5OlDDhG0Rslnz0gzJTnben2gu8nlURDmvw5h5Id-2Bx5VMnrhgdnp4aY-2BozfWGrBWGKaZIT9qtXaf-2FZGx3EBKf0b80gjLi56icoiyC9sjxUh0bKR3-2BHlI32Ar8psd3-2FnaXulSa-2FrMtower9ybcLZiJPYxB0Jb-2BOEm1d-2BBqtRi1TmGv-2FzenLEvo0G39kyUegbuM7EiMBnx4QY-3D" alt="" width="1" height="1" border="0" 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; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" 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=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________</span><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="">swift-evolution mailing list</span><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=""><a href="mailto:swift-evolution@swift.org" 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="">swift-evolution@swift.org</a><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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" 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="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></body></html>