File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
stdlib/public/SDK/ObjectiveC Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -211,9 +211,19 @@ extension NSObject : Equatable, Hashable {
211
211
/// different invocations of the same program. Do not persist the
212
212
/// hash value across program runs.
213
213
@objc
214
- open var hashValue : Int {
214
+ open // FIXME: should be @nonobjc public.
215
+ var hashValue : Int {
215
216
return hash
216
217
}
218
+
219
+ public final func _hash( into hasher: inout _Hasher ) {
220
+ // FIXME(hasher): We should call self.hash here; however, that would cause
221
+ // compatibility issues with code that mistakenly overrides hashValue rather
222
+ // than hash. (Types that do this break Foundation's hashing, but as long as
223
+ // they correctly override isEqual, they may still conform to Swift's
224
+ // Hashable.)
225
+ hasher. combine ( self . hashValue)
226
+ }
217
227
}
218
228
219
229
extension NSObject : CVarArg {
You can’t perform that action at this time.
0 commit comments