<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="">Hey Ray,<div class=""><br class=""></div><div class="">Feel free to take a look at the <a href="https://github.com/adrfer/Sort/tree/swift-3" class="">swift-3 branch of this repo</a>, too. There are several quick sort implementations there, from classic to Swift-y!</div><div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">— A</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 4, 2016, at 12:02 PM, Ray Fix via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div>I filed <a href="rdar://27700622" class="">rdar://27700622</a> and attached a playground. Any workaround magic I can do here?<div class=""><div class=""><br class=""></div><div class="">func quickSort<Element: Comparable>(_ input: [Element]) -> [Element] {</div><div class=""> if input.count < 2 {<br class=""> return input<br class=""> }<br class=""> let pivot = input.first!<br class=""> let left = input.dropFirst().filter { $0 <= pivot }<br class=""> let right = input.dropFirst().filter { $0 > pivot }<br class=""><br class=""> // Does not compile with (Swift 3pre) Xcode 8 b1,2,3,4<br class=""> // Does compile with (Swift 2.2) Xcode 7.3<br class=""> return quickSort(left) + [pivot] + quickSort(right)<br class="">}<br class=""><br class="">quickSort([3,5,1,2])</div><div class=""><br class=""></div><div class="">Error:</div><div class="">//Playground execution failed: error: quicksort.playground:11:22: error: cannot convert value of type '[Element]' to expected argument type '[_]'<br class="">//return quickSort(left) + [pivot] + quickSort(right)<br class="">// ^~~~</div></div><div class=""><br class=""></div><div class=""><br class=""></div></div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></div></body></html>