Skip to content

Instantly share code, notes, and snippets.

@RBusarow
Created July 13, 2019 20:33
Show Gist options
  • Save RBusarow/f34b51572cc0bbb2d97ac5d35c0b5c67 to your computer and use it in GitHub Desktop.
Save RBusarow/f34b51572cc0bbb2d97ac5d35c0b5c67 to your computer and use it in GitHub Desktop.
class CoroutineContext {
internal val map = mutableMapOf<Key<*>, Element>()
operator fun <E : Element> get(key: Key<E>): E? = map[key] as? E
interface Key<E : Element>
interface Element
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment