I'm trying to add a "combining" operation to a generic type using parameter packs but I can't get it to compile:
struct Box<Value> {
let value: Value
func zip<each A, each B>(
_ other: Box<(repeat each B)>
) -> Box<(repeat each A, repeat each B)>
where Value == (repeat each A) {
Box<(repeat each A, repeat each B)>(
value: (repeat each value, repeat each other.value)
)
}
}
It crashes the compiler (which I filed here), but I was wondering if there was a workaround or if I'm holding things wrong?