Issue #361

protocol Task {}

struct Build: Task {}
struct Test: Task {}

@_functionBuilder
public struct TaskBuilder {
    public static func buildBlock(_ tasks: Task...) -> [Task] {
        tasks
    }
}

public func run(@TaskBuilder builder: () -> [Task]) {
    MyManager.run(tasks: builder())
}

public func run(@TaskBuilder builder: () -> Task) {
    MyManager.run(tasks: [builder()])
}
run {
   Build()
   Test()
}

Read more