Maybe a dumb question. Given: ```suspendCancellabl...
# coroutines
e
Maybe a dumb question. Given:
Copy code
suspendCancellableCoroutine { continuation ->
  ...
  continuation.resume(...) // or resumeWithException
  ... other code
}
What happens to the code that is after
continuation.resume
?
👀 1
e
I expect it also runs, after the resumed coroutine suspends or terminates, unless resumption throws an exception. you can check easily…
e
Will give it a go soon. But, logically, is
resume
intended to be the last call in the code path?
Asking mostly because I would expect the compiler to warn me, at least. Or some kind of inspection
e
not in all cases, no
👀 1
e
Yes the code after
resume
runs btw, just tested
👌 1
Did you find cases where code after the resumption made sense?
e
it's meant for bridging with blocking apis and those could very often have some code that runs after a callback
✔️ 1