Skip to content

Commit 4b881f3

Browse files
committed
Fix new warnings after a rebase
Upgrading to Kotlin 2.2.20 brought new warnings, which this commit fixes.
1 parent 44927b6 commit 4b881f3

File tree

6 files changed

+11
-1
lines changed

6 files changed

+11
-1
lines changed

kotlinx-coroutines-core/nativeDarwin/test/MainDispatcherTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ import kotlin.test.*
1010

1111
class MainDispatcherTest : MainDispatcherTestBase.WithRealTimeDelay() {
1212

13+
@OptIn(ExperimentalForeignApi::class)
1314
override fun isMainThread(): Boolean = CFRunLoopGetCurrent() == CFRunLoopGetMain()
1415

1516
// skip if already on the main thread, run blocking doesn't really work well with that
1617
override fun shouldSkipTesting(): Boolean = isMainThread()
1718

19+
@OptIn(BetaInteropApi::class)
1820
override fun scheduleOnMainQueue(block: () -> Unit) {
1921
autoreleasepool {
2022
dispatch_async(dispatch_get_main_queue()) {

kotlinx-coroutines-core/wasmJs/test/PromiseTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import kotlinx.coroutines.testing.*
44
import kotlin.js.*
55
import kotlin.test.*
66

7+
@OptIn(ExperimentalWasmJsInterop::class)
78
class PromiseTest : TestBase() {
89
@Test
910
fun testPromiseResolvedAsDeferred() = GlobalScope.promise {

kotlinx-coroutines-core/wasmJs/test/PropagateExceptionFinalResortTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class PropagateExceptionFinalResortTest : TestBase() {
3030
}
3131
}
3232

33+
@OptIn(ExperimentalWasmJsInterop::class)
3334
private fun addUncaughtExceptionHandlerHelper() {
3435
js("""
3536
globalThis.exceptionCaught = false;
@@ -40,10 +41,12 @@ private fun addUncaughtExceptionHandlerHelper() {
4041
""")
4142
}
4243

44+
@OptIn(ExperimentalWasmJsInterop::class)
4345
private fun removeHandlerHelper() {
4446
js("""
4547
process.removeListener('uncaughtException', globalThis.exceptionHandler);
4648
""")
4749
}
4850

51+
@OptIn(ExperimentalWasmJsInterop::class)
4952
private fun exceptionCaught(): Boolean = js("globalThis.exceptionCaught")

kotlinx-coroutines-test/wasmJs/test/Helpers.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package kotlinx.coroutines.test
22

3+
@OptIn(ExperimentalWasmJsInterop::class)
34
actual fun testResultChain(block: () -> TestResult, after: (Result<Unit>) -> TestResult): TestResult =
45
block().then(
56
{

kotlinx-coroutines-test/wasmJs/test/PromiseTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import kotlinx.coroutines.*
44
import kotlin.test.*
55

66
class PromiseTest {
7+
@OptIn(ExperimentalWasmJsInterop::class)
78
@Test
89
fun testCompletionFromPromise() = runTest {
910
var promiseEntered = false
@@ -15,4 +16,4 @@ class PromiseTest {
1516
p.await<JsAny>()
1617
assertTrue(promiseEntered)
1718
}
18-
}
19+
}

test-utils/wasmJs/src/TestBase.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:OptIn(ExperimentalWasmJsInterop::class)
2+
13
package kotlinx.coroutines.testing
24

35
import kotlin.test.*

0 commit comments

Comments
 (0)