@@ -3,105 +3,105 @@ import Result
33// Observation
44extension SignalProducer where Value == Never {
55 @discardableResult
6- @available ( * , deprecated, message: " `Result.success` is never delivered - `Value` is inhabitable (Instantiation at runtime would trap) " )
7- public func startWithResult( _ action: @escaping ( Result < Value , Error > ) -> Void ) -> Disposable { observingInhabitableTypeError ( ) }
8-
9- @discardableResult
10- @available ( * , deprecated, message: " Observer is never called - `Value` is inhabitable (Instantiation at runtime would trap) " )
11- public func startWithValues( _ action: @escaping ( Value ) -> Void ) -> Disposable { observingInhabitableTypeError ( ) }
6+ @available ( * , deprecated, message: " `Result.success` is never delivered - value type `Never` is uninstantiable (Use at runtime would trap) " )
7+ public func startWithResult( _ action: @escaping ( Result < Value , Error > ) -> Void ) -> Disposable { observingUninhabitedTypeError ( ) }
128}
139
1410extension SignalProducer where Value == Never , Error == NoError {
1511 @discardableResult
16- @available ( * , deprecated, message: " Observer is never called - `Value` and `Error` are inhabitable (Instantiation at runtime would trap) " )
17- public func startWithResult( _ action: @escaping ( Result < Value , Error > ) -> Void ) -> Disposable { observingInhabitableTypeError ( ) }
12+ @available ( * , deprecated, message: " Observer is never called - value type `Never` and error type `NoError` are uninstantiable (Use at runtime would trap) " )
13+ public func startWithResult( _ action: @escaping ( Result < Value , Error > ) -> Void ) -> Disposable { observingUninhabitedTypeError ( ) }
14+
15+ @discardableResult
16+ @available ( * , deprecated, message: " Observer is never called - value type `Never` is uninstantiable (Use at runtime would trap) " )
17+ public func startWithValues( _ action: @escaping ( Value ) -> Void ) -> Disposable { observingUninhabitedTypeError ( ) }
1818}
1919
2020extension SignalProducer where Error == NoError {
2121 @discardableResult
22- @available ( * , deprecated, message: " `Error` is inhabitable so the observer is never called (Instantiation at runtime would trap)" )
23- public func startWithFailed( _ action: @escaping ( Error ) -> Void ) -> Disposable { observingInhabitableTypeError ( ) }
22+ @available ( * , deprecated, message: " Observer is never called - error type `NoError` is uninstantiable (Use at runtime would trap)" )
23+ public func startWithFailed( _ action: @escaping ( Error ) -> Void ) -> Disposable { observingUninhabitedTypeError ( ) }
2424}
2525
2626extension Signal where Value == Never {
2727 @discardableResult
28- @available ( * , deprecated, message: " `Result.success` is never delivered - `Value` is inhabitable (Instantiation at runtime would trap) " )
29- public func observeResult( _ action: @escaping ( Result < Value , Error > ) -> Void ) -> Disposable ? { observingInhabitableTypeError ( ) }
30-
31- @discardableResult
32- @available ( * , deprecated, message: " Observer is never called - `Value` is inhabitable (Instantiation at runtime would trap) " )
33- public func observeValues( _ action: @escaping ( Value ) -> Void ) -> Disposable ? { observingInhabitableTypeError ( ) }
28+ @available ( * , deprecated, message: " `Result.success` is never delivered - value type `Never` is uninstantiable (Use at runtime would trap) " )
29+ public func observeResult( _ action: @escaping ( Result < Value , Error > ) -> Void ) -> Disposable ? { observingUninhabitedTypeError ( ) }
3430}
3531
3632extension Signal where Value == Never , Error == NoError {
3733 @discardableResult
38- @available ( * , deprecated, message: " Observer is never called - `Value` and `Error` are inhabitable (Instantiation at runtime would trap) " )
39- public func observeResult( _ action: @escaping ( Result < Value , Error > ) -> Void ) -> Disposable ? { observingInhabitableTypeError ( ) }
34+ @available ( * , deprecated, message: " Observer is never called - value type `Never` and error type `NoError` are uninstantiable (Use at runtime would trap) " )
35+ public func observeResult( _ action: @escaping ( Result < Value , Error > ) -> Void ) -> Disposable ? { observingUninhabitedTypeError ( ) }
36+
37+ @discardableResult
38+ @available ( * , deprecated, message: " Observer is never called - value type `Never` is uninstantiable (Use at runtime would trap) " )
39+ public func observeValues( _ action: @escaping ( Value ) -> Void ) -> Disposable ? { observingUninhabitedTypeError ( ) }
4040}
4141
4242extension Signal where Error == NoError {
4343 @discardableResult
44- @available ( * , deprecated, message: " Observer is never invoked - `Error ` is inhabitable (Instantiation at runtime would trap) " )
45- public func observeFailed( _ action: @escaping ( Error ) -> Void ) -> Disposable ? { observingInhabitableTypeError ( ) }
44+ @available ( * , deprecated, message: " Observer is never invoked - error type `NoError ` is uninstantiable (Use at runtime would trap) " )
45+ public func observeFailed( _ action: @escaping ( Error ) -> Void ) -> Disposable ? { observingUninhabitedTypeError ( ) }
4646}
4747
4848// flatMap
4949extension SignalProducer where Value == Never {
5050 @discardableResult
51- @available ( * , deprecated, message: " Use `promoteValue` instead - `Value ` is inhabitable (Instantiation at runtime would trap) " )
52- public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> SignalProducer < Inner . Value , Error > where Inner. Error == Error { observingInhabitableTypeError ( ) }
51+ @available ( * , deprecated, message: " Use `promoteValue` instead - value type `Never ` is uninstantiable (Use at runtime would trap) " )
52+ public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> SignalProducer < Inner . Value , Error > where Inner. Error == Error { observingUninhabitedTypeError ( ) }
5353
5454 @discardableResult
55- @available ( * , deprecated, message: " Use `promoteValue` instead - `Value ` is inhabitable (Instantiation at runtime would trap) " )
56- public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> SignalProducer < Inner . Value , Error > where Inner. Error == NoError { observingInhabitableTypeError ( ) }
55+ @available ( * , deprecated, message: " Use `promoteValue` instead - value type `Never ` is uninstantiable (Use at runtime would trap) " )
56+ public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> SignalProducer < Inner . Value , Error > where Inner. Error == NoError { observingUninhabitedTypeError ( ) }
5757}
5858
5959extension SignalProducer where Value == Never , Error == NoError {
6060 @discardableResult
61- @available ( * , deprecated, message: " Use `promoteValue` instead - `Value ` and `Error ` are inhabitable (Instantiation at runtime would trap) " )
62- public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> SignalProducer < Inner . Value , Inner . Error > { observingInhabitableTypeError ( ) }
61+ @available ( * , deprecated, message: " Use `promoteValue` instead - value type `Never ` and error type `NoError ` are uninstantiable (Use at runtime would trap) " )
62+ public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> SignalProducer < Inner . Value , Inner . Error > { observingUninhabitedTypeError ( ) }
6363
6464 @discardableResult
65- @available ( * , deprecated, message: " Use `promoteValue` instead - `Value ` and `Error ` are inhabitable (Instantiation at runtime would trap) " )
66- public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> SignalProducer < Inner . Value , Inner . Error > where Inner. Error == Error { observingInhabitableTypeError ( ) }
65+ @available ( * , deprecated, message: " Use `promoteValue` instead - value type `Never ` and error type `NoError ` are uninstantiable (Use at runtime would trap) " )
66+ public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> SignalProducer < Inner . Value , Inner . Error > where Inner. Error == Error { observingUninhabitedTypeError ( ) }
6767}
6868
6969extension SignalProducer where Error == NoError {
7070 @discardableResult
71- @available ( * , deprecated, message: " Use `promoteError` instead - `Error ` is inhabitable (Instantiation at runtime would trap) " )
72- public func flatMapError< NewError> ( _ transform: @escaping ( Error ) -> SignalProducer < Value , NewError > ) -> SignalProducer < Value , NewError > { observingInhabitableTypeError ( ) }
71+ @available ( * , deprecated, message: " Use `promoteError` instead - error type `NoError ` is uninstantiable (Use at runtime would trap) " )
72+ public func flatMapError< NewError> ( _ transform: @escaping ( Error ) -> SignalProducer < Value , NewError > ) -> SignalProducer < Value , NewError > { observingUninhabitedTypeError ( ) }
7373}
7474
7575extension Signal where Value == Never {
7676 @discardableResult
77- @available ( * , deprecated, message: " Use `promoteValue` instead - `Value ` is inhabitable (Instantiation at runtime would trap) " )
78- public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> Signal < Inner . Value , Error > where Inner. Error == Error { observingInhabitableTypeError ( ) }
77+ @available ( * , deprecated, message: " Use `promoteValue` instead - value type `Never ` is uninstantiable (Use at runtime would trap) " )
78+ public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> Signal < Inner . Value , Error > where Inner. Error == Error { observingUninhabitedTypeError ( ) }
7979
8080 @discardableResult
81- @available ( * , deprecated, message: " Use `promoteValue` instead - `Value ` is inhabitable (Instantiation at runtime would trap) " )
82- public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> Signal < Inner . Value , Error > where Inner. Error == NoError { observingInhabitableTypeError ( ) }
81+ @available ( * , deprecated, message: " Use `promoteValue` instead - value type `Never ` is uninstantiable (Use at runtime would trap) " )
82+ public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> Signal < Inner . Value , Error > where Inner. Error == NoError { observingUninhabitedTypeError ( ) }
8383
8484}
8585
8686extension Signal where Value == Never , Error == NoError {
8787 @discardableResult
88- @available ( * , deprecated, message: " Use `promoteValue` instead - `Value ` and `Error ` are inhabitable (Instantiation at runtime would trap) " )
89- public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> Signal < Inner . Value , Inner . Error > { observingInhabitableTypeError ( ) }
88+ @available ( * , deprecated, message: " Use `promoteValue` instead - value type `Never ` and error type `NoError ` are uninstantiable (Use at runtime would trap) " )
89+ public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> Signal < Inner . Value , Inner . Error > { observingUninhabitedTypeError ( ) }
9090
9191 @discardableResult
92- @available ( * , deprecated, message: " Use `promoteValue` instead - `Value ` and `Error ` are inhabitable (Instantiation at runtime would trap) " )
93- public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> Signal < Inner . Value , Inner . Error > where Inner. Error == Error { observingInhabitableTypeError ( ) }
92+ @available ( * , deprecated, message: " Use `promoteValue` instead - value type `Never ` and error type `NoError ` are uninstantiable (Use at runtime would trap) " )
93+ public func flatMap< Inner: SignalProducerConvertible > ( _ strategy: FlattenStrategy , _ transform: @escaping ( Value ) -> Inner ) -> Signal < Inner . Value , Inner . Error > where Inner. Error == Error { observingUninhabitedTypeError ( ) }
9494}
9595
9696extension Signal where Error == NoError {
9797 @discardableResult
98- @available ( * , deprecated, message: " Use `promoteError` instead - `Error ` is inhabitable (Instantiation at runtime would trap) " )
99- public func flatMapError< NewError> ( _ transform: @escaping ( Error ) -> SignalProducer < Value , NewError > ) -> Signal < Value , NewError > { observingInhabitableTypeError ( ) }
98+ @available ( * , deprecated, message: " Use `promoteError` instead - error type `NoError ` is uninstantiable (Use at runtime would trap) " )
99+ public func flatMapError< NewError> ( _ transform: @escaping ( Error ) -> SignalProducer < Value , NewError > ) -> Signal < Value , NewError > { observingUninhabitedTypeError ( ) }
100100}
101101
102102@inline ( never)
103- private func observingInhabitableTypeError ( ) -> Never {
104- fatalError ( " Detected an attempt to instantiate a `Signal` or `SignalProducer` that observes an inhabitable type, e.g. `Never` or `NoError` . This is considered a logical error, and appropriate operators should be used instead. Please refer to the warnings raised by the compiler. " )
103+ private func observingUninhabitedTypeError ( ) -> Never {
104+ fatalError ( " Detected an attempt to observe ( or create streams to transform) uninstantiable events . This is considered a logical error, and appropriate operators should be used instead. Please refer to the warnings raised by the compiler. " )
105105}
106106
107107/*
0 commit comments