protocol P { // … // For example the following will not work: // static func foo<T, R>(_ v: T) -> R // Is there some other way? // … } struct S2 : P { static func foo<T>(_ v: T) -> (T, T) { return (v, v) } } struct S3 : P { static func foo<T>(_ v: T) -> (T, T, T) { return (v, v, v) } }
(I'm guessing but am not sure that I've run into (yet) a(nother) situation which would require higher kinded types?)
_______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users