You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to 2.0.0 I get failed builds with the following reason:
Suspension functions can only be called within coroutine body.
One reproducible case for example throwing this error is:
suspend fun suspendFunction(): Either<Unit, Unit> {
val result = Either.Left(Unit)
return result.handleErrorWith {
delay(500L)
Either.Right(Unit)
}
}
Notice that we are already in a suspend function so I would expect not to have an issue there calling any other suspend fun.
Currently handleErrorWith has the following signature: public fun <A, B, C> Either<A, B>.handleErrorWith(f: (A) -> Either<C, B>)
Transforming it to the below by adding the inline modifier as the other functions in Either solves the issue. public inline fun <A, B, C> Either<A, B>.handleErrorWith(f: (A) -> Either<C, B>)
The text was updated successfully, but these errors were encountered:
After upgrading to
2.0.0
I get failed builds with the following reason:One reproducible case for example throwing this error is:
Notice that we are already in a
suspend
function so I would expect not to have an issue there calling any othersuspend fun
.Currently
handleErrorWith
has the following signature:public fun <A, B, C> Either<A, B>.handleErrorWith(f: (A) -> Either<C, B>)
Transforming it to the below by adding the
inline
modifier as the other functions inEither
solves the issue.public inline fun <A, B, C> Either<A, B>.handleErrorWith(f: (A) -> Either<C, B>)
The text was updated successfully, but these errors were encountered: