It’s not the compiler, but IDEA inspection.
Jetbrains is trying to make clever “guess” - if your method throws IOException, it should dispached on IO thread pool.
How to avoid warning:
- Remove
@Throws
, Kotlin don’t need it - Suppress warning in IDEA with annotation
@Suppress("BlockingMethodInNonBlockingContext")
- Tried, but not worked for me - create your own custom annotation for functions and add it to “non-blocking” list in inspection settings