Closed Digipom closed 3 years ago
The current code doesn't compile with suspendCancellableCoroutine and the code needs to be changed to suspendCoroutine:
suspend fun FusedLocationProviderClient.awaitLastLocation(): Location = suspendCancellableCoroutine<Location> { continuation -> lastLocation.addOnSuccessListener { location -> continuation.resume(location) }.addOnFailureListener { e -> continuation.resumeWithException(e) } }
Cannot reproduce, the code from "step-06" folder compiles for me on a clean checkout and it matches the code you've shown.
The current code doesn't compile with suspendCancellableCoroutine and the code needs to be changed to suspendCoroutine: