minusPolymorphicKey

Deprecated

Warning since 2.4

Polymorphic coroutine context keys are error-prone, difficult to implement correctly, and can encourage depending on implementation details. Prefer retrieving the element by its base key and casting it explicitly when needed or introducing a dedicated extension property.

Returns empty coroutine context if the element is associated with the given key in a polymorphic manner or this otherwise. This method returns empty context if either Element.key is equal to the given key or if the key is associated with Element.key via AbstractCoroutineContextKey. See AbstractCoroutineContextKey for the example of usage.

Since Kotlin

1.3