<div dir="ltr">You may have to explain that metaphor (or link to an explanation) - what is 'trampoline' data?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 18, 2016 at 11:11 AM, Gwendal Roué <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> Le 18 avr. 2016 à 12:01, Yogev Sitton <<a href="mailto:yogev.sitton@gmail.com">yogev.sitton@gmail.com</a>> a écrit :<br>
><br>
> I’m referring you to Ross O’Brien’s post:<br>
> As of Swift 2.2, if a variable has a closure type of e.g. () -> Shape, a closure of type () -> Circle would be considered a match. If a class implements 'func make() -> Shape', a subclass implementing 'func make() -> Circle' has to override. However, if a protocol requires a 'func make() -> Shape', a type implementing 'func make() -> Circle' isn't considered to be conforming. That does seem strange.<br>
><br>
> Protocols behaves differently than closures and classes and I think they should behave the same.<br>
<br>
</span>All right, I get it.<br>
<br>
Shape, as a return type, is "trampoline" data that wraps any Shape value, when Circle is just a Circle. That's why the two functions () -> Shape? and () -> Circle? don't match today.<br>
<br>
But maybe they will eventually, thanks to your request!<br>
<div class="HOEnZb"><div class="h5"><br>
Gwendal<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>