kotlin.coroutines.suspendCoroutine and suggests replacing them with
kotlinx.coroutines.suspendCancellableCoroutine when the kotlinx.coroutines dependency is present.
The suspendCancellableCoroutine variant provides built-in cancellation support that is important
for structured concurrency and proper resource management.
Example:
suspend fun usage(): String {
return suspendCoroutine { continuation ->
continuation.resume("Hello!")
}
}
After the quick-fix is applied:
suspend fun usage(): String {
return suspendCancellableCoroutine { continuation ->
continuation.resume("Hello!")
}
}