[Gradle] RestrictedLifecycleStages: Reuse ContinuationInterceptor as Key

^KT-34662 Verification Pending
This commit is contained in:
Sebastian Sellmair
2023-03-16 17:44:15 +01:00
committed by Space Team
parent e76119b5eb
commit 9b8611ea9b
@@ -486,12 +486,8 @@ private class RestrictedLifecycleStages(
private val lifecycle: KotlinPluginLifecycle,
private val allowedStages: Set<Stage>,
) : CoroutineContext.Element, ContinuationInterceptor {
@OptIn(ExperimentalStdlibApi::class)
companion object Key : AbstractCoroutineContextKey<ContinuationInterceptor, RestrictedLifecycleStages>(
ContinuationInterceptor, { it as? RestrictedLifecycleStages }
)
override val key: CoroutineContext.Key<*> = Key
override val key: CoroutineContext.Key<*> = ContinuationInterceptor
override fun <T> interceptContinuation(continuation: Continuation<T>): Continuation<T> = object : Continuation<T> {
override val context: CoroutineContext