Avatar
AnyObjectに明示的にキャストすると幾つかのメソッドがチラ見できる
11:24 AM
@swiftbot import Foundation func foo<T: Any>(x: T) { print(x) } func bar<T: AnyObject>(x: T) { print(x) } foo(x: "") // bar(x: "") // 🙅 bar(x: "" as AnyObject)// 🙆 (edited)
🛠 1