https://kotlinlang.org logo
#eap
Title
# eap
e

Exerosis

02/14/2022, 3:54 AM
Am I missing an obvious way to do something like:
Copy code
<Context, Return> context(Context) operator fun ((Context) -> (Return)).invoke() = ...
Or is it safe to assume there this will never be possible? ;(
i

ilya.gorbunov

02/14/2022, 5:26 AM
Declare generic parameters of a contextual function the same way as of a plain function, i.e. after the
fun
keyword:
Copy code
context(Context) 
fun <Context> foo() ...
👍 1