mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib: Dictionary, Set: allow querying for a mismatched type when bridged
Swift's Dictionary and Set are typed, but when bridged to NSDictionary and NSSet they should behave accordingly, that is, allow querying for keys of arbitrary types. rdar://problem/23679193
This commit is contained in:
@@ -3275,7 +3275,9 @@ final internal class _Native${Self}StorageOwner<${TypeParametersDecl}>
|
||||
@warn_unused_result
|
||||
internal func bridgingObjectForKey(_ aKey: AnyObject)
|
||||
-> AnyObject? {
|
||||
let nativeKey = _forceBridgeFromObjectiveC(aKey, Key.self)
|
||||
guard let nativeKey = _conditionallyBridgeFromObjectiveC(aKey, Key.self)
|
||||
else { return nil }
|
||||
|
||||
let (i, found) = nativeStorage._find(
|
||||
nativeKey, startBucket: nativeStorage._bucket(nativeKey))
|
||||
if found {
|
||||
|
||||
Reference in New Issue
Block a user