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)// 🙆