I recently upgraded to IntelliJ 2019.3 and to Kotl...
# coroutines
d
I recently upgraded to IntelliJ 2019.3 and to Kotlin 1.3.61, and I'm starting to see a ton of "Inappropriate blocking method call" inspections. They mostly seem to be inside
suspend
functions where they call other
suspend
functions I wrote, so they seem like they may be spurious. Does anyone have any ideas about how to learn more about why these inspections are showing up, to either report a bug or to fix my code if it is in fact bad?
o
Those should only be marked on blocking methods such as Lock, any I/O calls, or things that throw InterruptedException. The fix is to ensure you are running those methods under Dispatchers.IO, but if they're suspend functions it sounds like a bug
d
Right, the highlighted function call in question is a function I wrote, not some sort of built in/library function
so I don't get if it's trying to tell me that the highlighted call somehow actually is blocking even though it's a suspend function (but there are no inspections showing up inside its own body), or what
o
yea, probably a bug. I would Invalidate Caches and restart IntelliJ, see if it persists
d
heh, i guess i don't need to get any work done for the next half hour 🙂
o
if so, check for an existing bug and file if none found
d
one thing that is odd is that when i searched the YT for the error message, all the references came back saying "inappropriate thread-blocking method call" but the inspection I'm seeing doesn't have
thread-
in it
Hmm maybe this is related to having an
@Throws
on my method?
t
I noticed that it mostly targets methods that throws
IOException
, as those methods will always perform IO in some way due to Java having checked exceptions.