Hi all, is it a bug that suspendability on a recei...
# coroutines
u
Hi all, is it a bug that suspendability on a receiver lambda has to be explicitly declared? If I have
Copy code
private suspend fun <T> (suspend () -> T).foo()
and
Copy code
private suspend fun <T> bar(lambda: suspend () -> T)
I need to explicitly write
suspend { delay(1)  }.foo()
but it’s fine to just call
bar { delay(1) }
without suspend keyword
Just in case this is considered a feature, then the bug is in Android Studio’s
Refactor->ChangeSignature
which does not add the `supsend`keyword to the call site when refactoring from
bar
to
foo
just realized, it’s not the
suspend
keword. It’s an inline function just to help the compiler
d
It's a little odd that the IDE makes it look like a keyword.
u
It doesn't. I just did not pay attention 😃