NSDateInterval hash is broken
| Originator: | jakebromberg | ||
| Number: | rdar://29205135 | Date Originated: | 10-Nov-2016 12:44 PM |
| Status: | Open | Resolved: | |
| Product: | Product Version: | ||
| Classification: | Reproducible: |
Summary: NSDateInterval objects that are equal are hashing to different values. Steps to Reproduce: Enter the following into your playground: import Foundation let startDate = Date() let endDate = startDate.addingTimeInterval(1000000) let intervalA = NSDateInterval(start: startDate, end: endDate) let intervalB = intervalA.copy() as! NSDateInterval intervalA.startDate == intervalB.startDate intervalA.endDate == intervalB.endDate intervalA == intervalB intervalA.hash == intervalB.hash Expected Results: Hash values of identical objects equate Actual Results: Hash values of identical objects aren't equal Version: iOS 10 Notes: Configuration: Playground Attachments: 'NSDateInterval Hash Test.playground.zip' was successfully uploaded.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!