Copy deprecated annotations on Job member to inheritors
* Makes them easier to find for cleanup
* Avoids bug with light classes
diff --git a/common/kotlinx-coroutines-core-common/src/JobSupport.kt b/common/kotlinx-coroutines-core-common/src/JobSupport.kt
index 63bc6bb..b6d0b0e 100644
--- a/common/kotlinx-coroutines-core-common/src/JobSupport.kt
+++ b/common/kotlinx-coroutines-core-common/src/JobSupport.kt
@@ -429,10 +429,13 @@
invokeOnCompletion(onCancelling = false, invokeImmediately = true, handler = handler)
@Suppress("OverridingDeprecatedMember")
+ @Deprecated(message = "For binary compatibility", level = DeprecationLevel.HIDDEN)
public final override fun invokeOnCompletion(handler: CompletionHandler, onCancelling: Boolean): DisposableHandle =
invokeOnCompletion(onCancelling = onCancelling, invokeImmediately = true, handler = handler)
@Suppress("OverridingDeprecatedMember")
+ @Deprecated(message = "Use with named `onCancellation` and `handler` parameters", level = DeprecationLevel.WARNING,
+ replaceWith = ReplaceWith("this.invokeOnCompletion(onCancellation = onCancelling_, handler = handler)"))
public final override fun invokeOnCompletion(onCancelling_: Boolean, handler: CompletionHandler): DisposableHandle =
invokeOnCompletion(onCancelling = onCancelling_, invokeImmediately = true, handler = handler)
@@ -878,6 +881,7 @@
}
@Suppress("OverridingDeprecatedMember")
+ @Deprecated(message = "Binary compatibility, it is an extension now", level = DeprecationLevel.HIDDEN)
public final override fun cancelChildren(cause: Throwable?) {
this.cancelChildren(cause) // use extension function
}
diff --git a/common/kotlinx-coroutines-core-common/src/NonCancellable.kt b/common/kotlinx-coroutines-core-common/src/NonCancellable.kt
index 1d60aa4..8c12ae5 100644
--- a/common/kotlinx-coroutines-core-common/src/NonCancellable.kt
+++ b/common/kotlinx-coroutines-core-common/src/NonCancellable.kt
@@ -84,6 +84,7 @@
*/
@Suppress("OverridingDeprecatedMember")
@InternalCoroutinesApi
+ @Deprecated(message = "For binary compatibility", level = DeprecationLevel.HIDDEN)
override fun invokeOnCompletion(handler: CompletionHandler, onCancelling: Boolean): DisposableHandle =
NonDisposableHandle
@@ -93,6 +94,8 @@
*/
@Suppress("OverridingDeprecatedMember")
@InternalCoroutinesApi
+ @Deprecated(message = "Use with named `onCancellation` and `handler` parameters", level = DeprecationLevel.WARNING,
+ replaceWith = ReplaceWith("this.invokeOnCompletion(onCancellation = onCancelling_, handler = handler)"))
override fun invokeOnCompletion(onCancelling_: Boolean, handler: CompletionHandler): DisposableHandle =
NonDisposableHandle
@@ -140,5 +143,6 @@
*/
@Suppress("OverridingDeprecatedMember")
@InternalCoroutinesApi
+ @Deprecated(message = "Binary compatibility, it is an extension now", level = DeprecationLevel.HIDDEN)
override fun cancelChildren(cause: Throwable?) {}
}