swift
95695910 - [4.2][stdlib] Make sure _SwiftNewtypeWrapper hashes the same way as its RawValue

Comment changes are shownComment changes are hidden
Commit
7 years ago
[4.2][stdlib] Make sure _SwiftNewtypeWrapper hashes the same way as its RawValue _SwiftNewtypeWrapper forwarded hashValue to its rawValue, but it failed to do the same for _hash(into:), which resulted in the wrapper struct having subtly different hashing than the raw value. This violated an implicit invariant when dictionaries/sets of such types were bridged to Objective-C through AnyHashable, leading to nondeterministic but frequent crashes. rdar://problem/39398060 (cherry picked from commit 6c5a6a6a16d0c080876bfe1b31ce366c7c33d1b9)
Author
Committer
Parents
  • stdlib/public/core
    • File
      NewtypeWrapper.swift