Accidentally typed in this ```suspend { //some sus...
# coroutines
x
Accidentally typed in this
Copy code
suspend { //some suspending calls here }
and this compiles just fine. Is this the same as
runBlocking{}
🤔
e
no, it creates a suspend lambda
similar to how
{ ... }
creates a lambda
x
Copy code
val x: suspend () -> Unit = suspend {  }
ah it all makes sense with type inference
e
suspend can be inferred, e.g.
Copy code
val x: suspend () -> Unit = { }
so it's rare that you need it on the lambda itself, but there might be some cases where it's useful for disambiguation