Avatar
norio_nomura 6/12/2017 3:17 PM
protocol P {} func f<T: P>(_ p: T) {} let int = 0 f(int as! P) // error: cannot invoke 'f' with an argument list of type '(P)' ぬうう (edited)
3:18 PM
protocol P {} func f<T: P>(_ p: T) {} func f2(_ any: Any) { if let p = any as? P { f(p) // error: cannot invoke 'f' with an argument list of type '(P)' } }