Has there been any discussions about the possibility of having generic associatedtypes?
I (naively) think that it would open up a lot of possibilities. Because if, for example, we could do this: protocol CountType { associatedtype Storage<E> ... } Then we could do this: struct Count1 : CountType { typealias Storage<E> = (E) ... } struct Count2 : CountType { typealias Storage<E> = (E, E) ... } struct Count3 : CountType { typealias Storage<E> = (E, E, E) ... } ... protocol StaticArrayType { associatedtype Count: CountType associatedtype Element ... } struct StaticArray<C: CountType, Element> : StaticArrayType { typealias Count = C var storage: C.Storage<Element> ... } Would adding support for generic associatedtypes be possible? Are there any plans for it? ( I tried searching for it but I found only this: https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160411/015089.html ) Thanks, /Jens
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution