<div dir="ltr"><div>Because it would break this:</div><div><br></div><div>func foo<T: C, U: A> (c: T, a: U) { c.test(a) }</div><div><br></div><div>Nevin</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 17, 2018 at 2:29 AM, Roshan via swift-users <span dir="ltr"><<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Here is some sample code that gives a protocol conformance error in a<br>
playground:<br>
<br>
protocol A {}<br>
protocol B: A {}<br>
<br>
protocol C {<br>
func test(x: A)<br>
}<br>
<br>
class M: C {<br>
func test(x: B) {}<br>
}<br>
<br>
Is there a reason why the compiler doesn't infer that ((B) -> ())<br>
matches ((A) -> ()) because of inheritance?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Warm regards<br>
Roshan<br>
______________________________<wbr>_________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
</font></span></blockquote></div><br></div>