func toAny<X>(_ x: X) -> Any { x as Any } let s = "foo" let os = Optional(s) let a1 = toAny(s) as! AnyHashable let a2 = toAny(os) as! AnyHashable print(a1.hashValue, a2.hashValue, a1 == a2)