Expected Behavior
When I have a Task type like so:
class Task: Withable {
var name: String
var absolutePriority: UInt64? = nil
}
I should be able to write code like this:
let tasks: [Task] = [
SingleTask(name: "Task1").with { $0.absolutePriority = -100 },
SingleTask(name: "Task2").with { $0.absolutePriority = -50 },
SingleTask(name: "Task3").with { $0.absolutePriority = 0 },
SingleTask(name: "Task4").with { $0.absolutePriority = 25 },
SingleTask(name: "Task5").with { $0.absolutePriority = 50 },
]
Actual Behavior
It's not building because Withable requires my type not not have any parameters in the init method, which shouldn't be the case.
Steps to Reproduce the Problem
See code above.
Specifications
- Version: 3.2.0
- Platform: macOS 10.15.4
- IDE Version: Xcode 11.5
Expected Behavior
When I have a
Tasktype like so:I should be able to write code like this:
Actual Behavior
It's not building because
Withablerequires my type not not have any parameters in theinitmethod, which shouldn't be the case.Steps to Reproduce the Problem
See code above.
Specifications