Skip to content

[SR-3172] Set<AnyHashable> isn't bridging to NSNumber correctly #45760

@ChristopherRogers

Description

@ChristopherRogers
Previous ID SR-3172
Radar rdar://problem/29026017
Original Reporter @ChristopherRogers
Type Bug
Status Closed
Resolution Done
Environment

Xcode 8.1, Swift 3.0.1
Xcode 8.1, Development Snapshot 2016-11-09

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, SDKOverlay
Assignee None
Priority Medium

md5: 7c87927e15a61fb97e3113802a6eade2

Issue Description:

All of these statements except the last evaluate to true. I believe it should be true as well. This affects Swift to Objective-C bridging where the Objective-C code isn't using lightweight generics.

([42] as Array as NSArray).contains(42)
([42] as Array as NSArray).contains(NSNumber(value: 42))
([42] as Array<AnyHashable> as NSArray).contains(42)
([42] as Array<AnyHashable> as NSArray).contains(NSNumber(value: 42))
([42] as Set as NSSet).contains(42)
([42] as Set as NSSet).contains(NSNumber(value: 42))
([42] as Set<AnyHashable> as NSSet).contains(42)
([42] as Set<AnyHashable> as NSSet).contains(NSNumber(value: 42)) // false

Metadata

Metadata

Assignees

No one assigned

    Labels

    SDKOverlaybugA deviation from expected or documented behavior. Also: expected but undesirable behavior.standard libraryArea: Standard library umbrella

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions