Skip to content

Commit

Permalink
Add tricky test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sidepelican committed May 26, 2021
1 parent 47ab296 commit 7e19342
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Tests/PublisherBuilderTests/FlatMapExtensionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,22 @@ final class FlatMapExtensionTests: XCTestCase {
}
}
.eraseToAnyPublisher()

let _: AnyPublisher<[String], CustomError> = customErrorSubject
.flatMapBuild { v in
if v.isEmpty {
Just([])
} else {
Fail(error: CustomError())
}
}
.eraseToAnyPublisher()
}
}

extension Publisher {
// this extension method breaks some type inference
func unused() -> Empty<Int, Failure> { // result type should be some Publisher where Failure == Self.Failure
fatalError()
}
}

0 comments on commit 7e19342

Please sign in to comment.