<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi All,<div class=""><br class=""></div><div class="">I have a function which returns a closure, which then returns an array of objects conforming to a protocol. </div><div class=""><br class=""></div><div class="">ie. </div><div class=""><br class=""></div><div class=""><p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Courier; color: rgb(16, 16, 16);" class="">protocol MyProtocol {}</p>
<p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Courier; color: rgb(16, 16, 16); min-height: 16px;" class=""><br class=""></p>
<p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Courier; color: rgb(16, 16, 16);" class="">extension Float: MyProtocol {}</p>
<p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Courier; color: rgb(16, 16, 16);" class="">extension OtherType: MyProtocol {}</p></div><div class=""><br class=""></div><div class="">When I try to return an array of Floats, I get the error “Cannot convert value of type '[Float]' to closure result type ‘[MyProtocol]”.</div><div class=""><br class=""></div><div class="">Other struct-based types work fine.</div><div class=""><br class=""></div><div class="">Is this not possible with standard library types?</div><div class=""><br class=""></div><div class="">Regards,</div><div class=""><br class=""></div><div class="">Ryan</div></body></html>