I'm exploring Kotlin's recent addition, Context parameters.
Under certain circumstances, a code block can have one or several contexts available without a direct way to reference them (there's no variable bound to them). They're accessible solely to forward into calls of functions taking context parameters.
What's the conventional way to retrieve one of these unnamed contexts?
I made this tiny utility to get at it:
context(current: C) inline fun <reified C> grabContext() = current
However, perhaps a standard function already does this.