Is there an option to design a FunctionalInterface...
# getting-started
h
Is there an option to design a FunctionalInterface (from Java) in a library (with some annotations?) that a Kotlin/JVM user uses the interface with the first parameter being the receiver?
a
or, if the Java type is annotated, the Kotlin user can use the sam-with-receiver plugin https://kotlinlang.org/docs/sam-with-receiver-plugin.html
h
Will take a look, but the method has multiple parameters and only the first one should be the receiver. And with SAM, the user needs to apply it manually/via a Gradle plugin instead of just consuming the library.
e
there was a proposal https://github.com/Kotlin/KEEP/issues/110 but it was dropped