rtsketo
12/13/2022, 9:22 AMfun foo(() -> Unit): Unit = ...
suspend foo(suspend () -> Unit): Unit = ...
For example, to make foo(..)
suspend only if its argument is suspend also.
The above code does compile, but foo { }
is ambiguous.ephemient
12/13/2022, 9:24 AMprivate inline fun fooImpl(() -> Unit): Unit = ...
fn foo(() -> Unit): Unit = fooImpl(...)
suspend fun foo(suspend () -> Unit): Unit = fooImpl(...)
louiscad
12/17/2022, 4:40 PM