Unio 0.9.0 introduces some breaking changes.
Those changes are related SR-12081.
- [ADD]
AnyLogicBasedStream<Input: InputType, Output: OutputType>
- [REPLACE]
typealias UnioStream<Logic: LogicType> = PrimitiveStream<Logic> & LogicType
->typealias UnioStream<Logic: LogicType> = AnyLogicBasedStream<Logic.Input, Logic.Output> & LogicType
- Previous
UnioStream<Logic: LogicType>
(less than 0.8.0) hadinit(input: Input, state: State, extra: Extra)
as the designated initializer. CurrentUnioStream<Logic: LogicType>
(greater than 0.9.0) also hasinit(input: Input, state: State, extra: Extra)
but it is the convenience initializer. So, you should fix initializers like that.
Before
init(extra: Extra) {
super.init(input: Input(), state: State(), extra: extra)
}
After
convenience init(extra: Extra) {
self.init(input: Input(), state: State(), extra: extra)
}
If you defined some properties in UnioStream subclasses, you must change initializers to like that.
Before
class NumberStream: UnioStream<NumberStream> {
let number: Int
init(number: Int, extra: Extra) {
self.number = number
super.init(input: Input(), state: State(), extra: extra)
}
}
After
class NumberStream: UnioStream<NumberStream> {
let number: Int
init(number: Int, extra: Extra) {
self.number = number
super.init(input: Input(), state: State(), extra: extra, logic: NumberStream.self)
}
@available(*, unavailable)
init<Logic: LogicType>(input: Logic.Input,
state: Logic.State,
extra: Logic.Extra,
logic _: Logic.Type) where Input == Logic.Input, Output == Logic.Output {
fatalError("could not be called anymore")
}
}
- If you want to use existing UnioStream initializer (less than 0.8.0), please define
typealise UnioSteram<Logic: LogicType> = SR12081.UnioSteram<Logic>
in your Application Target.