It makes sense since protocol do not allow final. It doesn't make much sense to allow the extensions to be exempt from this.<br><br>Classes that inherit from it can still provide their own implementation of the supposed "final" protocol method which is contradictory to what final means.<br><br>Protocol extensions should not allow final since the protocol definition doesn't allow it either.<br><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 7, 2017 at 10:23 PM Brian King via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div style="font-size:12.8px" class="gmail_msg">Hey Folks, <span style="font-size:12.8px" class="gmail_msg">This draft proposal addresses </span><span style="font-size:12.8px" class="gmail_msg">starter bug SR-1762.</span><span style="font-size:12.8px" class="gmail_msg"> I believe this is in scope for Swift 4 since it impacts source compatibility</span><span style="font-size:12.8px" class="gmail_msg">. It's not a very exciting proposal, but I think it will help make Swift a little more consistent.</span></div><div style="font-size:12.8px" class="gmail_msg"><span style="font-size:12.8px" class="gmail_msg"><br class="gmail_msg"></span></div><div style="font-size:12.8px" class="gmail_msg"><span style="font-size:12.8px" class="gmail_msg"><a href="https://gist.github.com/KingOfBrian/6f20c566114ac0ef54c8092d80e54ee7" class="gmail_msg" target="_blank">https://gist.github.com/KingOfBrian/6f20c566114ac0ef54c8092d80e54ee7</a></span><br class="gmail_msg"></div><div style="font-size:12.8px" class="gmail_msg"><a href="https://bugs.swift.org/browse/SR-1762" class="gmail_msg" target="_blank">https://bugs.swift.org/browse/SR-1762</a></div><div style="font-size:12.8px" class="gmail_msg"><br class="gmail_msg"></div><div style="font-size:12.8px" class="gmail_msg">Thanks</div><div style="font-size:12.8px" class="gmail_msg"><br class="gmail_msg"></div><div style="font-size:12.8px" class="gmail_msg">Brian</div><div style="font-size:12.8px" class="gmail_msg"><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg">Introduction</h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><p style="font-size:16px;font-weight:normal;box-sizing:border-box;margin-top:0px;margin-bottom:16px" class="gmail_msg">This proposal suggests removing support for the <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;font-size:13.6px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.0470588);border-radius:3px" class="gmail_msg">final</code> keyword when declaring a function in a protocol extension. The presence of the <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;font-size:13.6px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.0470588);border-radius:3px" class="gmail_msg">final</code> keyword does not currently generate an error message, and it does not actually modify the dispatch behavior in any way.</p></h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><a id="m_4040040636499159322gmail-user-content-motivation" class="m_4040040636499159322gmail-anchor gmail_msg" href="https://gist.github.com/KingOfBrian/6f20c566114ac0ef54c8092d80e54ee7#motivation" style="color:rgb(3,102,214);box-sizing:border-box;background-color:transparent;text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"></a>Motivation</h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><p style="font-size:16px;font-weight:normal;box-sizing:border-box;margin-top:0px;margin-bottom:16px" class="gmail_msg">In the original protocol model of Swift, a developer could use the <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;font-size:13.6px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.0470588);border-radius:3px" class="gmail_msg">final</code> keyword when declaring a function in a protocol extension to ensure the function could not be overridden. This keyword has no use in Swift's current protocol model, since functions in protocol extensions can not be overridden and will always use direct dispatch.</p></h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><a id="m_4040040636499159322gmail-user-content-detailed-design" class="m_4040040636499159322gmail-anchor gmail_msg" href="https://gist.github.com/KingOfBrian/6f20c566114ac0ef54c8092d80e54ee7#detailed-design" style="color:rgb(3,102,214);box-sizing:border-box;background-color:transparent;text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"></a>Detailed design</h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><p style="font-size:16px;font-weight:normal;box-sizing:border-box;margin-top:0px;margin-bottom:16px" class="gmail_msg">The compiler should generate an error or warning when the <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;font-size:13.6px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.0470588);border-radius:3px" class="gmail_msg">final</code> keyword is used on a function declaration inside of a protocol extension. This is consistent with the use of <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,"liberation mono",menlo,courier,monospace;font-size:13.6px;padding:0.2em 0px;margin:0px;background-color:rgba(27,31,35,0.0470588);border-radius:3px" class="gmail_msg">final</code> in structs and enumerations.</p></h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><a id="m_4040040636499159322gmail-user-content-source-compatibility" class="m_4040040636499159322gmail-anchor gmail_msg" href="https://gist.github.com/KingOfBrian/6f20c566114ac0ef54c8092d80e54ee7#source-compatibility" style="color:rgb(3,102,214);box-sizing:border-box;background-color:transparent;text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"></a>Source compatibility</h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><p style="font-size:16px;font-weight:normal;box-sizing:border-box;margin-top:0px;margin-bottom:16px" class="gmail_msg">This change will impact source compatibility. To maintain compatibility with Swift 3, a warning will be generated in Swift 3 mode instead of an error message.</p></h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><a id="m_4040040636499159322gmail-user-content-effect-on-abi-stability" class="m_4040040636499159322gmail-anchor gmail_msg" href="https://gist.github.com/KingOfBrian/6f20c566114ac0ef54c8092d80e54ee7#effect-on-abi-stability" style="color:rgb(3,102,214);box-sizing:border-box;background-color:transparent;text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"></a>Effect on ABI stability</h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><p style="font-size:16px;font-weight:normal;box-sizing:border-box;margin-top:0px;margin-bottom:16px" class="gmail_msg">This has no effect on ABI stability</p></h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><a id="m_4040040636499159322gmail-user-content-effect-on-api-resilience" class="m_4040040636499159322gmail-anchor gmail_msg" href="https://gist.github.com/KingOfBrian/6f20c566114ac0ef54c8092d80e54ee7#effect-on-api-resilience" style="color:rgb(3,102,214);box-sizing:border-box;background-color:transparent;text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"></a>Effect on API resilience</h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><p style="font-size:16px;font-weight:normal;box-sizing:border-box;margin-top:0px;margin-bottom:16px" class="gmail_msg">This has no effect on API resilience</p></h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><a id="m_4040040636499159322gmail-user-content-alternatives-considered" class="m_4040040636499159322gmail-anchor gmail_msg" href="https://gist.github.com/KingOfBrian/6f20c566114ac0ef54c8092d80e54ee7#alternatives-considered" style="color:rgb(3,102,214);box-sizing:border-box;background-color:transparent;text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"></a>Alternatives considered</h2><h2 style="font-family:-apple-system,blinkmacsystemfont,"segoe ui",helvetica,arial,sans-serif,"apple color emoji","segoe ui emoji","segoe ui symbol";box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom:1px solid rgb(234,236,239)" class="gmail_msg"><p style="font-size:16px;font-weight:normal;box-sizing:border-box;margin-top:0px;margin-bottom:0px" class="gmail_msg">The only alternative would be to not fix this bug</p></h2></div></div>
_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>