diff --git a/Sources/SignalProducer.swift b/Sources/SignalProducer.swift index 52fa990d9..431adb83a 100644 --- a/Sources/SignalProducer.swift +++ b/Sources/SignalProducer.swift @@ -538,6 +538,7 @@ extension SignalProducer where Error == Swift.Error { } } +#if swift(>=5.7) /// Represents reactive primitives that can be represented by `SignalProducer`. public protocol SignalProducerConvertible { /// The type of values being sent by `self`. @@ -549,7 +550,21 @@ public protocol SignalProducerConvertible { /// The `SignalProducer` representation of `self`. var producer: SignalProducer { get } } +#else +/// Represents reactive primitives that can be represented by `SignalProducer`. +public protocol SignalProducerConvertible { + /// The type of values being sent by `self`. + associatedtype Value + + /// The type of error that can occur on `self`. + associatedtype Error: Swift.Error + + /// The `SignalProducer` representation of `self`. + var producer: SignalProducer { get } +} +#endif +#if swift(>=5.7) /// A protocol for constraining associated types to `SignalProducer`. public protocol SignalProducerProtocol { /// The type of values being sent by `self`. @@ -561,6 +576,19 @@ public protocol SignalProducerProtocol { /// The materialized `self`. var producer: SignalProducer { get } } +#else +/// A protocol for constraining associated types to `SignalProducer`. +public protocol SignalProducerProtocol { + /// The type of values being sent by `self`. + associatedtype Value + + /// The type of error that can occur on `self`. + associatedtype Error: Swift.Error + + /// The materialized `self`. + var producer: SignalProducer { get } +} +#endif extension SignalProducer: SignalProducerConvertible, SignalProducerProtocol { public var producer: SignalProducer {