<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I’d like to revive this idea I posted long time ago. There is only one thing I need to update here:</div><div id="bloop_customfont" style="color: rgb(0, 0, 0); margin: 0px;"><blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="bloop_markdown"><pre><code class="swift">protocol MagicType: class /* missed the class constraint */ {
final var foo: Int { get }
final func boo()
}
</code></pre></div></div></blockquote><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="bloop_markdown"><pre><font face="Helvetica">What do you guys think? Is there any technical reason why this is not possible?</font></pre></div></div></div></div> <div id="bloop_sign_1463593849621687040" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Adrian Zubarev<br>Sent with Airmail</div></div> <br><p class="airmail_on">Am 5. Dezember 2015 bei 16:26:23, Adrian Zubarev (<a href="mailto:adrian.zubarev@devandartist.com">adrian.zubarev@devandartist.com</a>) schrieb:</p> <blockquote type="cite" class="clean_bq"><span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div></div><div>
<title></title>
<div class="bloop_markdown">
<p>Hello there,</p>
<p>I wonder if it is a good idea to be able to finalize in
protocols and default implementations.</p>
<p>Here is an example:</p>
<pre><code class="swift">protocol MagicType {
final var foo: Int { get }
final func boo()
}
class X: MagicType {
final var foo: Int {
return 42
}
final func boo() {
print("magic")
}
}
class Y: X {
// can't override func boo or var foo in here
}
//===================================================//
protocol SomeType {}
extension SomeType {
final func foo() {
print("Hello World")
}
}
class A: SomeType {}
class B: SomeType {
/* this should raise an error, because the class B shouldn't */
/* be able to override that function from SomeType */
func foo() {
// do something else
}
}
</code>
</pre></div>
<div class="bloop_original_html">
<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">
<br></div>
<br>
<div id="bloop_sign_1449328153152813056" class="bloop_sign">
<div><font face="helvetica, arial">— </font></div>
<div>Regards Adrian<br></div>
</div>
</div>
<div class="bloop_markdown"></div>
</div></div></span></blockquote></body></html>