1 min readJun 3, 2019
This is done to avoid silent errors. Someone could have written observeOn
operator as withContext(ctx) { collect { emit(it) } }
hoping that this operator would change the “downstream” context. If that were to be silently “corrected” it will be hard to catch this misunderstanding in the test. We don’t just throw an exception. We also give clues as to what operators to look at in its message.