Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# master
*Please add new entries at the top.*

# 6.0.1

1. Add support for Xcode 11 / Swift 5.1 (#739, kudos to @NachoSoto)


# 6.0.0
1. Dropped support for Swift 4.2 (Xcode 9)
2. Removed dependency on https://github.com/antitypical/Result (#702, kudos to @NachoSoto and @mdiep)
Expand Down
26 changes: 16 additions & 10 deletions Sources/Event.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1015,17 +1015,23 @@ extension Signal.Event where Value == Never {
internal static func promoteValue<U>(_: U.Type) -> Transformation<U, Error> {
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<U>() -> Signal<U, Error>.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
}
}
}
2 changes: 1 addition & 1 deletion Sources/Signal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()) }
}
}
}
Expand Down