Alexandru Hadăr
12/21/2021, 12:28 PMmbonnin
12/21/2021, 1:02 PMstreetsofboston
12/21/2021, 3:30 PMclass MyElement(...) : Element {
...
fun hello() { ... }
companion object : Key<MyElement>
}
...
...
coroutineContext[MyElement] = MyElement(...)
...
coroutineContext[MyElement].hello()
^-- key is companion object
Alexandru Hadăr
12/21/2021, 9:37 PM