The ExpressibleByArrayLiteral
initializer has the signature:
init(arrayLiteral elements: ArrayLiteralElement...)
So the first problem is that Somecollection.Element
is not known to be the same type as Somecollection.ArrayLiteralElement
.
However the second problem is that Swift does not currently provide a way to “splat” an existing array into a variadic argument list.
Here are a couple links to Swift Evolution discussions about solving that issue:
- Another attempt at passing arrays as varargs (with implementation) (July 2019)
- Yet another varargs “splat” proposal (September 2019)