Hi, does any one thought about concept - "*Explicit Catch Exceptions*"? It would be a kind of exception which can be caught by specifying it explicitly try { } catch (e:ExceptionType) { } and impossible to catch in otheF ways.
For e.g. this would solve problems with CancellationException propagation, using flow api.
Currently there are cases where we need to explicitly catch and rethrow these "internal" exceptions and code is like: try {} catch (e:CancellationException) { throw e } catch(e:Exception) { }
Usage would be annotate exception class with @ExplicitOnly annotation like this:
@ExplicitOnly public expect open class CancellationException(message: String?) : IllegalStateException