So, context parameters, nee receivers. I see that the compiler now says Experimental context receivers are deprecated and will be superseded by context parameters. Please don’t use context receivers. You can either pass parameters explicitly or use members with extensions. Passing parameters explicitly I understand, but what exactly is meant by use members with extensions? I would like if possible to maintain at least some of the structure that my existing context receivers gave in the interregnum during which neither context receivers nor context parameters will be supported
dmcg
09/26/2024, 8:07 AM
Also, please do tell me if there is another Slack channel more appropriate for this question
a
Alejandro Serrano.Mena
09/26/2024, 8:17 AM
that means that instead of
context(A) fun foo(..)
you can try to use
fun A.foo(..)
o
okarm
09/26/2024, 8:25 AM
I think that specifically calls out the ability to replace up to 2-arity context using an extension that is a member of a class
Something like this:
Copy code
instead of
context(A, B) fun foo()
use
Class A {
fun B.foo() {}
}
To answer your other question, #CQ3GFJTU1 or even #C0B8MA7FA would be a better place to ask. This channel is specifically for proposing changes to the language:
> All discussion in this channel should begin with a use-case or proposal instead of a question. #CQ3GFJTU1 can be used for other discussions and for questions.