diff --git a/Sources/Event.swift b/Sources/Event.swift index 578a604dc..7c2495c52 100644 --- a/Sources/Event.swift +++ b/Sources/Event.swift @@ -1015,17 +1015,23 @@ extension Signal.Event where Value == Never { internal static func promoteValue(_: U.Type) -> Transformation { return { action, _ in return { event in - switch event { - case .value: - fatalError("Never is impossible to construct") - case let .failed(error): - action(.failed(error)) - case .completed: - action(.completed) - case .interrupted: - action(.interrupted) - } + action(event.promoteValue()) } } } } + +extension Signal.Event where Value == Never { + internal func promoteValue() -> Signal.Event { + switch event { + case .value: + fatalError("Never is impossible to construct") + case let .failed(error): + return .failed(error) + case .completed: + return .completed + case .interrupted: + return .interrupted + } + } +} diff --git a/Sources/Signal.swift b/Sources/Signal.swift index 5f361d845..039bc9a83 100644 --- a/Sources/Signal.swift +++ b/Sources/Signal.swift @@ -1848,7 +1848,7 @@ extension Signal { } for (index, action) in builder.startHandlers.enumerated() where !lifetime.hasEnded { - lifetime += action(index, strategy) { observer.send($0.map { _ in fatalError() }) } + lifetime += action(index, strategy) { observer.send($0.promoteValue()) } } } }