Are same-type variadic generic requirements available is some Swift version?

I'm talking about things like:

func variadic<each S: Sequence, T>(_: repeat each S) where repeat (each S).Element == T {}

I wanted an initializer that took in many different types with the same protocol conformance and the same Element type, but the all-parameters-match-a-single-type requirement doesn't work for me (Xcode 15.4 on MacOS 14.5); giving a "Same-element requirements are not yet supported" message.

1 Like

No, not yet.

1 Like

I would love to see this happen. I have hit this limitation countless times and I can't wait for @simanerush work to be merged in master.

3 Likes

Is this feature on the queue for a not-so-distant future release?

No, not yet.