[swift-evolution] Proposal: Change of syntax for class protocols

Guillaume Lessard glessard at tffenterprises.com
Mon Dec 7 14:49:59 CST 2015


> On 7 déc. 2015, at 09:58, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
> 
> The constraint syntax is used because, in the fullness of time, it should also be applicable to type parameters and associated types:
> 
> protocol Foo { typealias T: class }
> 
> func foo<T: class>(x: T)

Is using the AnyObject protocol significantly less desirable in those cases?

(It may be that you consider AnyObject to be a workaround…)

Guillaume Lessard



More information about the swift-evolution mailing list