Skip to content

Commit 9d1c62a

Browse files
authored
Get rid of ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS to reduce the tensi… (#3869)
* Get rid of ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS to reduce the tension between develop and K2 branches * Remove obsolete workaround Target ticket: KT-61577
1 parent 2d64ba1 commit 9d1c62a

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package kotlinx.coroutines
88

99
import kotlin.test.*
1010

11-
@Suppress("DEPRECATION") // cancel(cause)
1211
class AsyncTest : TestBase() {
1312

1413
@Test

kotlinx-coroutines-core/js/test/TestBase.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public actual typealias TestResult = Promise<Unit>
1515

1616
public actual val isNative = false
1717

18-
@Suppress("NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS") // Counterpart for @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
1918
public actual open class TestBase actual constructor() {
2019
public actual val isBoundByJsTestTimeout = true
2120
private var actionIndex = 0
@@ -27,8 +26,7 @@ public actual open class TestBase actual constructor() {
2726
* Throws [IllegalStateException] like `error` in stdlib, but also ensures that the test will not
2827
* complete successfully even if this exception is consumed somewhere in the test.
2928
*/
30-
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
31-
public actual fun error(message: Any, cause: Throwable? = null): Nothing {
29+
public actual fun error(message: Any, cause: Throwable?): Nothing {
3230
if (cause != null) console.log(cause)
3331
val exception = IllegalStateException(
3432
if (cause == null) message.toString() else "$message; caused by $cause")

kotlinx-coroutines-core/jvm/test/TestBase.kt

+2-5
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ public actual typealias TestResult = Unit
5555
* ```
5656
*/
5757
@Suppress(
58-
// Counterpart for @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
59-
"NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS",
6058
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
6159
"ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER"
6260
)
@@ -81,13 +79,12 @@ public actual open class TestBase(private var disableOutCheck: Boolean) {
8179
*/
8280
private lateinit var previousOut: PrintStream
8381

84-
/**
82+
/**
8583
* Throws [IllegalStateException] like `error` in stdlib, but also ensures that the test will not
8684
* complete successfully even if this exception is consumed somewhere in the test.
8785
*/
8886
// fixme replace the suppress with AllowDifferentMembersInActual once stdlib is updated to 1.9.20 https://github.com/Kotlin/kotlinx.coroutines/issues/3846
89-
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
90-
public actual fun error(message: Any, cause: Throwable? = null): Nothing {
87+
public actual fun error(message: Any, cause: Throwable?): Nothing {
9188
throw makeError(message, cause)
9289
}
9390

kotlinx-coroutines-core/native/test/TestBase.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public actual val isNative = true
1515
@Suppress("ACTUAL_WITHOUT_EXPECT")
1616
public actual typealias TestResult = Unit
1717

18-
@Suppress("NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS") // Counterpart for @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
1918
public actual open class TestBase actual constructor() {
2019
public actual val isBoundByJsTestTimeout = false
2120
private var actionIndex = atomic(0)
@@ -26,8 +25,7 @@ public actual open class TestBase actual constructor() {
2625
* Throws [IllegalStateException] like `error` in stdlib, but also ensures that the test will not
2726
* complete successfully even if this exception is consumed somewhere in the test.
2827
*/
29-
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
30-
public actual fun error(message: Any, cause: Throwable? = null): Nothing {
28+
public actual fun error(message: Any, cause: Throwable?): Nothing {
3129
val exception = IllegalStateException(message.toString(), cause)
3230
if (error == null) error = exception
3331
throw exception

0 commit comments

Comments
 (0)