File tree Expand file tree Collapse file tree 3 files changed +4
-0
lines changed
kotlinx-coroutines-guava/src
kotlinx-coroutines-play-services/src
kotlinx-coroutines-core/common/test Expand file tree Collapse file tree 3 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ public fun <T> ListenableFuture<T>.asDeferred(): Deferred<T> {
151
151
cancel(false )
152
152
}
153
153
// Return hides the CompletableDeferred. This should prevent casting.
154
+ @OptIn(InternalForInheritanceCoroutinesApi ::class )
154
155
return object : Deferred <T > by deferred {}
155
156
}
156
157
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ private fun <T> Task<T>.asDeferredImpl(cancellationTokenSource: CancellationToke
87
87
}
88
88
}
89
89
// Prevent casting to CompletableDeferred and manual completion.
90
+ @OptIn(InternalForInheritanceCoroutinesApi ::class )
90
91
return object : Deferred <T > by deferred {}
91
92
}
92
93
Original file line number Diff line number Diff line change @@ -353,6 +353,7 @@ class AwaitTest : TestBase() {
353
353
fun testAwaitAllDelegates () = runTest {
354
354
expect(1 )
355
355
val deferred = CompletableDeferred <String >()
356
+ @OptIn(InternalForInheritanceCoroutinesApi ::class )
356
357
val delegate = object : Deferred <String > by deferred {}
357
358
launch {
358
359
expect(3 )
@@ -367,6 +368,7 @@ class AwaitTest : TestBase() {
367
368
fun testCancelAwaitAllDelegate () = runTest {
368
369
expect(1 )
369
370
val deferred = CompletableDeferred <String >()
371
+ @OptIn(InternalForInheritanceCoroutinesApi ::class )
370
372
val delegate = object : Deferred <String > by deferred {}
371
373
launch {
372
374
expect(3 )
You can’t perform that action at this time.
0 commit comments