Skip to content

Commit 38e0e99

Browse files
committed
Add ExperimentalCoroutinesApi opt-in as compiler option
Removes the need to manually annotate each class that uses it.
1 parent dcb85a6 commit 38e0e99

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

buildSrc/src/main/kotlin/kotlin-conventions.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
2-
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
33

44
plugins {
55
kotlin("multiplatform")
@@ -13,7 +13,7 @@ kotlin {
1313

1414
jvm {
1515
compilerOptions {
16-
jvmTarget.set(JvmTarget.JVM_1_8)
16+
jvmTarget.set(JVM_1_8)
1717
}
1818
}
1919

kotlin-result-coroutines/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ plugins {
77
kotlin {
88
explicitApi()
99

10+
compilerOptions {
11+
optIn.add("kotlinx.coroutines.ExperimentalCoroutinesApi")
12+
}
13+
1014
sourceSets {
1115
commonMain {
1216
dependencies {

kotlin-result-coroutines/src/commonTest/kotlin/com/github/michaelbull/result/coroutines/AsyncCoroutineBindingTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.github.michaelbull.result.coroutines
33
import com.github.michaelbull.result.Err
44
import com.github.michaelbull.result.Ok
55
import com.github.michaelbull.result.Result
6-
import kotlinx.coroutines.ExperimentalCoroutinesApi
76
import kotlinx.coroutines.async
87
import kotlinx.coroutines.delay
98
import kotlinx.coroutines.launch
@@ -14,7 +13,6 @@ import kotlin.test.assertEquals
1413
import kotlin.test.assertFalse
1514
import kotlin.test.assertTrue
1615

17-
@ExperimentalCoroutinesApi
1816
class AsyncCoroutineBindingTest {
1917

2018
private sealed interface BindingError {

kotlin-result-coroutines/src/commonTest/kotlin/com/github/michaelbull/result/coroutines/CoroutineBindingTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ package com.github.michaelbull.result.coroutines
33
import com.github.michaelbull.result.Err
44
import com.github.michaelbull.result.Ok
55
import com.github.michaelbull.result.Result
6-
import kotlinx.coroutines.ExperimentalCoroutinesApi
76
import kotlinx.coroutines.delay
87
import kotlinx.coroutines.test.runTest
98
import kotlin.test.Test
109
import kotlin.test.assertEquals
1110
import kotlin.test.assertFalse
1211
import kotlin.test.assertTrue
1312

14-
@ExperimentalCoroutinesApi
1513
class CoroutineBindingTest {
1614

1715
private object BindingError

kotlin-result-coroutines/src/commonTest/kotlin/com/github/michaelbull/result/coroutines/ParZipTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ package com.github.michaelbull.result.coroutines
33
import com.github.michaelbull.result.Err
44
import com.github.michaelbull.result.Ok
55
import kotlinx.coroutines.CompletableDeferred
6-
import kotlinx.coroutines.ExperimentalCoroutinesApi
76
import kotlinx.coroutines.delay
87
import kotlinx.coroutines.launch
98
import kotlinx.coroutines.test.advanceTimeBy
109
import kotlinx.coroutines.test.runTest
1110
import kotlin.test.Test
1211
import kotlin.test.assertEquals
1312

14-
@ExperimentalCoroutinesApi
1513
class ParZipTest {
1614

1715
data class ZipData3(val a: String, val b: Int, val c: Boolean)

kotlin-result-coroutines/src/commonTest/kotlin/com/github/michaelbull/result/coroutines/RunSuspendCatchingTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import com.github.michaelbull.result.Err
44
import com.github.michaelbull.result.Ok
55
import com.github.michaelbull.result.onSuccess
66
import kotlinx.coroutines.CoroutineName
7-
import kotlinx.coroutines.ExperimentalCoroutinesApi
87
import kotlinx.coroutines.cancel
98
import kotlinx.coroutines.delay
109
import kotlinx.coroutines.launch
@@ -14,7 +13,6 @@ import kotlin.test.Test
1413
import kotlin.test.assertEquals
1514
import kotlin.test.assertNull
1615

17-
@ExperimentalCoroutinesApi
1816
class RunSuspendCatchingTest {
1917

2018
@Test

0 commit comments

Comments
 (0)