Open
Description
Previous ID | SR-13056 |
Radar | None |
Original Reporter | jaspa (JIRA User) |
Type | Bug |
Attachment: Download
Environment
Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Target: x86_64-apple-darwin19.5.0
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler, Foundation |
Labels | Bug, Runtime |
Assignee | None |
Priority | Medium |
md5: bdaa20b6bf7a6aef772d4ccd188017e9
Issue Description:
Compare this
import Foundation
let unit: () = ()
let unitAny = unit as Any
let unitObject1 = unit as AnyObject
let unitObject2 = unit as AnyObject
unit == unit // true
unitObject1.isEqual(unit) // false
unitObject1.isEqual(unitObject1) // true
unitObject1.isEqual(unitObject2) // false
with
import Foundation
let num = 12345678987
let numAny = num as Any
let numObject1 = num as AnyObject
let numObject2 = num as AnyObject
num == num // true
numObject1.isEqual(num) // true
numObject1.isEqual(numObject1) // true
numObject1.isEqual(numObject2) // true
I expect all expression in the first code block to be true
analogous to the second code block.