Open
Description
What feature would you like to see?
protected interface ProvideError {
Exception getError();
}
This interface public
How would you use it?
Allowing it to be public, you could then create Kotlin extension on the highest generic upper bound of StorageTask
like:
fun Continuation<Unit>.resume(): Unit =
resumeWith(Result.success(Unit))
suspend fun <T : StorageTask.ProvideError> StorageTask<T>.await() = suspendCancellableCoroutine<Unit> { cont ->
val l = OnCompleteListener<T> { cont.resume() }
addOnCompleteListener(l)
cont.invokeOnCancellation { removeOnCompleteListener(l) }
}