Skip to content

Commit

Permalink
Remove protection from downcasting in asDeferred
Browse files Browse the repository at this point in the history
To work around Kotlin#2423.
  • Loading branch information
vadimsemenov committed Dec 1, 2020
1 parent e00d7d8 commit 356e873
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions integration/kotlinx-coroutines-guava/src/ListenableFuture.kt
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ public fun <T> ListenableFuture<T>.asDeferred(): Deferred<T> {
deferred.invokeOnCompletion {
cancel(false)
}
// Return hides the CompletableDeferred. This should prevent casting.
return object : Deferred<T> by deferred {}
// TODO: prevent down casting when #2423 is fixed.
return deferred
}

/**
Expand Down

0 comments on commit 356e873

Please sign in to comment.