<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">In the following piece of code, can somebody explain the last result? Why the break in consistency? Is this a bug?<div class=""><br class=""></div><div class=""><font face="Menlo" class="">protocol P {<br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>func foo() -> String<br class="">}<br class=""><br class="">extension P {<br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>func foo() -> String { return "P" }<br class="">}<br class=""><br class="">class A : P {<br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>func foo() -> String { return "A" }<br class="">}<br class=""><br class="">class B : P {}<br class="">class C : B {<br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>func foo() -> String { return "C" }<br class="">}<br class=""><br class="">A().foo() // A<br class="">(A() as P).foo() // A<br class="">B().foo() // P<br class="">(B() as P).foo() // P<br class="">C().foo() // C<br class="">(C() as P).foo() // P</font></div></body></html>