[swift-evolution] [Idea] Typealias for protocols with associated types

Maximilian HĂĽnenberger m.huenenberger at me.com
Thu Feb 4 13:20:11 CST 2016


There is already a similar thread: [swift-evolution] Partially Constrained Protocols

There we discussed a more improved generics system including "true" generics for protocols with associated types:

var collection: CollectionType<Generator.Element == Int>

// if CollectionType had an Element typealias to Generator.Element

var collection: CollectionType<Element == Int>


Best regards
- Maximilian

> Am 04.02.2016 um 19:01 schrieb Jessy Catterwaul via swift-evolution <swift-evolution at swift.org>:
> 
> I agree, as long as the typealias and second use of the type name is not necessary.
> 
> Because 
> extension CollectionType where Generator.Element == Int {}
> compiles…
> 
> var collection: CollectionType where Generator.Element == Int
> should also.
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160204/cfefd9e2/attachment.html>


More information about the swift-evolution mailing list