I am using custom implementation of
Hashable protocol on my classes using fairly primitive logic using
Hasher.combine() on several
String/Int based fields.
Everything seems to be working really well on Linux, macOS, and iOS 10, 11, 12, 13, 14.
On iOS 9 with the app compiled using Xcode 11.5 however I started receiving lot of random crashes where an object used as a key in a
Dictionary is not there, swift crashes with
Dictionary containing duplicate keys, etc.
It all points toward some kind of issue where for my objects during the app run
Hasher.combine() is called multiple times for the same object with different random seed, thus generating different
hashValue for the same object during the same app run.
To indicate, here is the precondition on line 5 that fails:
1. let key = SomeKey() 2. let dict = [:] 3. precondition(dict[key] == nil, "") 4. dict[key] = SomeObject() 5. precondition(dict[key] != nil, "")
I'm trying to figure out whether this rings a bell for somebody since it is 100% iOS 9 specific.
thanks for any pointers,