Hi, I'm exploring using the new parameter packs in result builders, as is now done in SwiftUI, but I'm getting this weird error (even though I'm essentially following how SwiftUI does it):
@resultBuilder
public struct FormBuilder {
public static func buildBlock<each Content: FormComponent>(_ content: repeat each Content) -> TupleFormComponent<(repeat each Content)> {
return TupleFormComponent<each Content>(content: content)
}
}
Gives the error Type '(repeat each Content)' does not conform to protocol 'FormComponent'
.
The FormComponent
struct looks like this:
public struct TupleFormComponent<each Component: FormComponent>: FormComponent { ... }
So to me it feels like this should work. Let me know if you think I made any glaring mistakes!