Skip to content

Commit 2ec8c28

Browse files
dkhalanskyjbqwwdfsad
authored andcommitted
Add INVISIBLE_REFERENCE to every INVISIBLE_MEMBER suppression
1 parent 2d852a5 commit 2ec8c28

File tree

15 files changed

+22
-22
lines changed

15 files changed

+22
-22
lines changed

kotlinx-coroutines-test/common/src/TestCoroutineDispatchers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private class UnconfinedTestDispatcherImpl(
9393

9494
override fun isDispatchNeeded(context: CoroutineContext): Boolean = false
9595

96-
@Suppress("INVISIBLE_MEMBER")
96+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
9797
override fun dispatch(context: CoroutineContext, block: Runnable) {
9898
checkSchedulerInContext(scheduler, context)
9999
scheduler.sendDispatchEvent(context)

kotlinx-coroutines-test/common/src/TestScope.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ internal class TestScopeImpl(context: CoroutineContext) :
231231
* However, we also want [uncaughtExceptions] to be queried after the callback is registered,
232232
* because the exception collector will be able to report the exceptions that arrived before this test but
233233
* after the previous one, and learning about such exceptions as soon is possible is nice. */
234-
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
234+
@Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
235235
run { ensurePlatformExceptionHandlerLoaded(ExceptionCollector) }
236236
if (catchNonTestRelatedExceptions) {
237237
ExceptionCollector.addOnExceptionCallback(lock, this::reportException)
@@ -288,7 +288,7 @@ internal class TestScopeImpl(context: CoroutineContext) :
288288
if (finished) {
289289
throw throwable
290290
} else {
291-
@Suppress("INVISIBLE_MEMBER")
291+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
292292
for (existingThrowable in uncaughtExceptions) {
293293
// avoid reporting exceptions that already were reported.
294294
if (unwrap(throwable) == unwrap(existingThrowable))

kotlinx-coroutines-test/common/src/internal/ExceptionCollector.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ internal object ExceptionCollector : AbstractCoroutineContextElement(CoroutineEx
8181
return executedACallback
8282
}
8383

84-
@Suppress("INVISIBLE_MEMBER")
84+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
8585
override fun handleException(context: CoroutineContext, exception: Throwable) {
8686
if (handleException(exception)) {
8787
throw ExceptionSuccessfullyProcessed

kotlinx-coroutines-test/common/src/internal/TestMainDispatcher.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ internal class TestMainDispatcher(delegate: CoroutineDispatcher):
9191
}
9292
}
9393

94-
@Suppress("INVISIBLE_MEMBER")
94+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
9595
private val defaultDelay
9696
inline get() = DefaultDelay
9797

98-
@Suppress("INVISIBLE_MEMBER")
98+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
9999
internal expect fun Dispatchers.getTestMainDispatcher(): TestMainDispatcher

kotlinx-coroutines-test/common/test/RunTestTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class RunTestTest {
166166
it()
167167
fail("unreached")
168168
} catch (e: UncompletedCoroutinesError) {
169-
@Suppress("INVISIBLE_MEMBER")
169+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
170170
val suppressed = unwrap(e).suppressedExceptions
171171
assertEquals(1, suppressed.size, "$suppressed")
172172
assertIs<TestException>(suppressed[0]).also {
@@ -207,7 +207,7 @@ class RunTestTest {
207207
fn()
208208
fail("unreached")
209209
} catch (e: UncompletedCoroutinesError) {
210-
@Suppress("INVISIBLE_MEMBER")
210+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
211211
val suppressed = unwrap(e).suppressedExceptions
212212
assertEquals(1, suppressed.size, "$suppressed")
213213
assertIs<TestException>(suppressed[0]).also {

kotlinx-coroutines-test/js/src/internal/TestMainDispatcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package kotlinx.coroutines.test.internal
66
import kotlinx.coroutines.*
77

8-
@Suppress("INVISIBLE_MEMBER")
8+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
99
internal actual fun Dispatchers.getTestMainDispatcher(): TestMainDispatcher =
1010
when (val mainDispatcher = Main) {
1111
is TestMainDispatcher -> mainDispatcher

kotlinx-coroutines-test/jvm/src/migration/TestCoroutineExceptionHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class TestCoroutineExceptionHandler :
5555
private val _lock = SynchronizedObject()
5656
private var _coroutinesCleanedUp = false
5757

58-
@Suppress("INVISIBLE_MEMBER")
58+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
5959
override fun handleException(context: CoroutineContext, exception: Throwable) {
6060
synchronized(_lock) {
6161
if (_coroutinesCleanedUp) {

kotlinx-coroutines-test/jvm/test/migration/RunTestLegacyScopeTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class RunTestLegacyScopeTest {
9292
fn()
9393
fail("unreached")
9494
} catch (e: UncompletedCoroutinesError) {
95-
@Suppress("INVISIBLE_MEMBER")
95+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
9696
val suppressed = unwrap(e).suppressedExceptions
9797
assertEquals(1, suppressed.size)
9898
assertIs<TestException>(suppressed[0]).also {

kotlinx-coroutines-test/native/src/internal/TestMainDispatcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package kotlinx.coroutines.test.internal
66
import kotlinx.coroutines.*
77

8-
@Suppress("INVISIBLE_MEMBER")
8+
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
99
internal actual fun Dispatchers.getTestMainDispatcher(): TestMainDispatcher =
1010
when (val mainDispatcher = Main) {
1111
is TestMainDispatcher -> mainDispatcher

reactive/kotlinx-coroutines-reactive/src/Publish.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public class PublisherCoroutine<in T>(
8484
// Mutex is locked when either nRequested == 0 or while subscriber.onXXX is being invoked
8585
private val mutex: Mutex = Mutex(locked = true)
8686

87-
@Suppress("UNCHECKED_CAST", "INVISIBLE_MEMBER")
87+
@Suppress("UNCHECKED_CAST", "INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
8888
override val onSend: SelectClause2<T, SendChannel<T>> get() = SelectClause2Impl(
8989
clauseObject = this,
9090
regFunc = PublisherCoroutine<*>::registerSelectForSend as RegistrationFunction,

0 commit comments

Comments
 (0)