Crash when using Empty, replaceError, and switchToLatest

The following results in a crash:

Code Block swift
import Combine
let subject = PassthroughSubject<String, Error>()
let cancellable = subject.map { _ in
    Empty<String?, Error>().replaceError(with: nil)
}
.switchToLatest()
.sink {
    print($0)
} receiveValue: {
    print($0 ?? "<none>")
}
subject.send("") // EXC_BAD_INSTRUCTION


Am I doing something wrong, or is this a bug? Filed as FB9042788.
Crash when using Empty, replaceError, and switchToLatest
 
 
Q