Explain to me please one generic initializing error

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:

1 Like