[Pitch] Parameter Packs

Actually the suffix ... operator returns a PartialRangeFrom<C>.
I think in your code each argument has type (PartialRangeFrom<T>..., U) and in order to get (PartialRangeFrom<T>, U) we need to write

func acceptAnything<T...>(_: T...) {}

func ranges<T..., U...>(values: T..., otherValues: U...) where T: Comparable, length(Ts...) == length(Us...) {
  func range<C: Comparable, V>(from comparable: C, and value: V) -> (PartialRangeFrom<C>, V) {
    return (comparable..., value)
  }
  
  acceptAnything(range(from: values, and: otherValues)...) 
}
1 Like