Is there a way to change an extension function's r...
# getting-started
e
Is there a way to change an extension function's receiver name as it appears in Java as a function param? I was hoping for
@receiver:JvmName
but that doesn't appear to be supported. I would like to avoid the automatic names like
$this$something
or
$self
for the java interop as those names aren't particularly informative.
d
If you're designing a Java interop API, its probably best to avoid receivers anyway, since it doesn't improve the Java experience in any way.
👍 1
e
The primary target is for Kotlin use, but there are a handful of older java projects that will be updated to use the library. They will be forced to use
someFunc(foo, bar)
instead of
foo.someFunc(bar)
but that's not the worst thing in the world. However, there are a few extensions that are being marked with
@JvmSynthetic
because it wouldn't make sense to use them from java.
👍 1