[Pitch] Parameter Packs

I don’t necessarily agree with this. The element type of packs could be considered the union of all types making up the pack. Since the types making up the pack are unknown in the generic context, they could be opaque types that expose the constraints placed on the parameter pack’s elements. In pseudo Swift

typealias H = (Bool, Int, String)

H.Element.self // (Bool | Int | String).self

func hello<pack Values>(values: expand Values) {
  (expand Values).Element.self // some Any
}

To be clear, I’m not proposing a union feature, just exploring a conceptual model for the type of pack elements.

1 Like