What is the difference between `kotlinx.coroutines...
# coroutines
n
What is the difference between
kotlinx.coroutines.CancellationException
and
kotlin.coroutines.cancellation.CancellationException
? Thanks.
s
They're the same. In theory, cancellation behaviour for coroutines is defined in the
kotlinx.coroutines
library, so that's where the
CancellationException
would ideally live. In practice, the compiler has to know about cancellation exceptions for awkward reasons of compatibility, hence the additional
kotlin.coroutines.cancellation.CancellationException
declaration.
👌 1
🙏 1
1
d
Copy code
package kotlinx.coroutines
typealias CancellationException = kotlin.coroutines.cancellation.CancellationException
🙏 2
j
@Dmitry Khalanskiy [JB] it'd be nice if the stdlib one could be deprecated/hidden somehow to avoid confusion
2
d
Ok, I'll raise this proposal.