Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)
Apple Swift version 4.1-dev (LLVM bdcc78a6ed, Clang 27a368e018, Swift 2e48f09e2e)
Apple Swift version 4.1 (swiftlang-902.0.34 clang-902.0.30)
Additional Detail from JIRA
SR-6515 Subdata of Data returned from URLSession is equal, but has different hash value
The second argument in the closure passed to Data's enumerateBytes method is a Data.Index. But, of course, the Data being operated on may be a slice. So does the index parameter represent a zero-based index offset from the beginning of the data, as in Swift 3, or does it start at a non-zero .startIndex as in Swift 4?
As you see, the index is zero-based for a pure-Swift data slice, but is non-zero-based for a Data that began life as a dispatch_data_t from Objective-C. So the upshot is that if you use the index for anything, the result will be like the proverbial box of chocolates.
The text was updated successfully, but these errors were encountered: