I'm using the compiler that comes with Xcode 15.4.
@available(macOS 14.0.0, *) // Need to replace with "swift" version
public struct MyType<
First: Collection,
Second: Collection,
Third: Collection,
each Suffix: Collection
> {
//...
}
@available(macOS 14.0.0, *) // Need to replace with "swift" version
extension MyType: IteratorProtocol {
public func next() -> (First.Element, Second.Element, Third.Element, XXX)? {
return nil
}
}
What do I put at XXX
?
each Suffix.Element
gives "Pack reference 'Suffix.Element' requires expansion using keyword 'repeat'"repeat each Suffix.Element
gives "'each' cannot be applied to non-pack type '(each Suffix).Element'"repeat Suffix.Element
gives "Type pack 'Suffix.Element' must be referenced with 'each'"repeat Suffix.each Element
gives both "Expected ',' separator" and "Type pack 'Suffix.each' must be referenced with 'each'" Trying the suggested fixes crashes Xcode.repeat each (Suffix).Element
gives "'each' cannot be applied to non-pack type '(each Suffix).Element'"repeat each (Suffix.Element)
gives "'each' cannot be applied to non-pack type '(each Suffix).Element'"
I expect the most obvious one, the second, to work. The sixth is kind of acceptable, same for the fifth.