Skip to content

Commit 2d9f944

Browse files
authored
Add missing opt-ins for InternalForInheritanceCoroutinesApi (#4171)
Should have no effect on the user code, just fixing the internal warnings.
1 parent 0f4b546 commit 2d9f944

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

integration/kotlinx-coroutines-guava/src/ListenableFuture.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ public fun <T> ListenableFuture<T>.asDeferred(): Deferred<T> {
151151
cancel(false)
152152
}
153153
// Return hides the CompletableDeferred. This should prevent casting.
154+
@OptIn(InternalForInheritanceCoroutinesApi::class)
154155
return object : Deferred<T> by deferred {}
155156
}
156157

integration/kotlinx-coroutines-play-services/src/Tasks.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ private fun <T> Task<T>.asDeferredImpl(cancellationTokenSource: CancellationToke
8787
}
8888
}
8989
// Prevent casting to CompletableDeferred and manual completion.
90+
@OptIn(InternalForInheritanceCoroutinesApi::class)
9091
return object : Deferred<T> by deferred {}
9192
}
9293

kotlinx-coroutines-core/common/test/AwaitTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ class AwaitTest : TestBase() {
353353
fun testAwaitAllDelegates() = runTest {
354354
expect(1)
355355
val deferred = CompletableDeferred<String>()
356+
@OptIn(InternalForInheritanceCoroutinesApi::class)
356357
val delegate = object : Deferred<String> by deferred {}
357358
launch {
358359
expect(3)
@@ -367,6 +368,7 @@ class AwaitTest : TestBase() {
367368
fun testCancelAwaitAllDelegate() = runTest {
368369
expect(1)
369370
val deferred = CompletableDeferred<String>()
371+
@OptIn(InternalForInheritanceCoroutinesApi::class)
370372
val delegate = object : Deferred<String> by deferred {}
371373
launch {
372374
expect(3)

0 commit comments

Comments
 (0)