Hello! In my java code I have method `void test...
# announcements
p
Hello! In my java code I have method
void test(Consumer<Test> consumer)
When I call it from kotlin
test{ it.doSmth() }
What should I do to be abble to call it from java like this
test{ this.doSmth() }
so it must behave as extension function lambda
d
Java has no concept of extension functions or "lambda with receiver".
k
I guess he meant kotlin not java. what to change in java to call it like that in kotlin
d
I know. But that would still mean Java needs to understand those concepts so that you can write code with them in mind.
p
May be there is some annotation to mark in java and so to tell kotlin that first parameter of java method should be treated as receiver.