I have a conditional statement which should return Deferred result in both cases, but I don't know how to manually create Deferred object with predefined result. Here's code snapshot:
val deferredResult = if (condition) {
callSuspendFunction(params)
} else {
deferred???
}
callSuspendFunction returns the result of async operation. Although I can write something like coroutineScope { async { result } } instead of deferred???, but it looks really not what it should be.