Funny, I thought propery testing's `forAll` allows...
# kotest
d
Funny, I thought propery testing's
forAll
allows using suspend funs in it's lambda? It seems like not though... even though forAll itself is a suspend fun...
s
Yeah it does, cos its inline
so it inherits the suspend from the outer function
d
When I tried, the IDE complained that I can't call a suspend fun outside a coroutine context, but when I used checkAll it works...
I'm on 5.8.0
Copy code
public suspend inline fun <reified A> checkAll(noinline property: suspend io.kotest.property.PropertyContext.(A) -> kotlin.Unit): io.kotest.property.PropertyContext
Copy code
public suspend inline fun <reified A> forAll(crossinline property: io.kotest.property.PropertyContext.(A) -> kotlin.Boolean): io.kotest.property.PropertyContext
It seems like that forAll overload doesn't have suspend, just crossinline...
s
oh right, interesting
d
I get this:
Suspension functions can be called only within coroutine body