Avatar
Avatar
nanasi
@swift-5.7.3 @swift-main private extension Equatable { func isEquals(_ other: any Equatable) -> Bool { guard let other = other as? Self else { return false } return self == other } } public func == (lhs: any Equatable, rhs: any Equatable) -> Bool { lhs.isEquals(rhs) } let i: any Equatable = 1 let d: any Equatable = 1.0 let i2: any Equatable = 1 print(i == d) // print(i == i2) (edited)
swiftNightly BOT 11/5/2022 4:40 AM
false (edited)