Roman Elizarov
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.

--

--

Roman Elizarov
Roman Elizarov

Written by Roman Elizarov

Project Lead for the Kotlin Programming Language @JetBrains

No responses yet