https://kotlinlang.org logo
#language-evolution
Title
# language-evolution
c

carbaj0

04/19/2022, 7:14 AM
Hi! trying the context receivers, i got this error
Copy code
object Dependency {
    val dep1: String = "1"
}

val lambda: context(Dependency)() -> Unit = {
    dep1
}
e

efemoney

04/19/2022, 1:44 PM
For lambdas you need to pass in context as a parameterr
c

carbaj0

04/19/2022, 2:57 PM
this would be temporal or will be improved in the future?
e

efemoney

04/19/2022, 2:57 PM
Probably temporary and should be improved in the future
🤞 3
s

simon.vergauwen

04/29/2022, 12:52 PM
@carbaj0 there is a workaround for this, but you have to redefine
with
to make it work. https://gist.github.com/nomisRev/6c31a24e6d0dbf0106b10a9048162929
5 Views