Avatar
omochimetaru 2/3/2021 7:44 AM
静的なキャストじゃだめだな・・・
7:44 AM
@swift-5.3.3 @swift-5.4.3 func toAH<X>(_ x: X) -> AnyHashable { x as! AnyHashable } let s = "foo" let os = Optional(s) print(type(of: toAH(s)), type(of: toAH(os)), type(of: toAH(s) as Any), type(of: toAH(os) as Any)) (edited)