<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><a href="https://github.com/apple/swift/pull/3819" class="">https://github.com/apple/swift/pull/3819</a><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px;" class="">As I understand it, Array may be backed by contiguous storage (if native) or it may be backed by some exotic NSArray subclass. We provide a related type with stronger backing guarantees: ContiguousArray (and indeed, in my algorithmic code, I can see a total execution time <b class="">halve</b> by switching from one to the other -- which may be a bug, but in any case there are differences which is why we have the type in the first place).</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px;" class="">Unfortunately, there is no way to vend a ContiguousArray as a regular Array. If you wish to make use of the stronger guarantees of ContiguousArray in your algorithm, everybody who uses those results must also use ContiguousArray or else you will have to copy the data.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px;" class="">I know it's late for Swift 3. I literally only noticed this today, otherwise I would have mentioned it earlier.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px;" class="">It seems like a reasonably large hole with a simple fix. Going from ContiguousArray to Array is a kind-of upcasting conversion and should be allowed -- it seems like that's almost the whole point of the type.</p></blockquote></div><div class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px;" class=""><br class=""></p></div></body></html>