You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)
Target: x86_64-apple-darwin19.4.0
Additional Detail from JIRA
Votes
0
Component/s
Foundation
Labels
Bug
Assignee
None
Priority
Medium
md5: f612f4b8f118de9fb060ad3aeb286e34
Issue Description:
On Data instances which reference other instances, subscript crashes on valid indices. For example:
import Foundation
letoriginal=Data([1,2,3])letadvanced= original.advanced(by:1)// .count = 2letdropped= original.dropFirst().// .count = 2
let thisWorks=advanced[0]letthisCrashes=dropped[0]letthisAlsoWorks= dropped.first!
I am not familiar with Foundation source code, but I see that in __DataStorage.get, the effective index is calculated as index - offset. Shouldn't that be index + offset?
The text was updated successfully, but these errors were encountered:
Environment
Xcode 11.4 on macOS 10.15.4
Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)
Target: x86_64-apple-darwin19.4.0
Additional Detail from JIRA
md5: f612f4b8f118de9fb060ad3aeb286e34
Issue Description:
On Data instances which reference other instances, subscript crashes on valid indices. For example:
I am not familiar with Foundation source code, but I see that in __DataStorage.get, the effective index is calculated as
index - offset
. Shouldn't that beindex + offset
?The text was updated successfully, but these errors were encountered: