I'm in the process of converting my codebase from Java to Kotlin, and we're converting a few classes at a time. During this process today, I noticed a really weird interop issue that I'm hoping there's a way around.
I had a package protected Java class that I converted to an internal Kotlin class. Here's an abridged version of the class:
internal class Request private constructor(internal val method: String) {
...
}
I've noticed that when I attempt to use this class from Java (within the same package), it appends the build name and a dollar sign to the end of my getter for method
. Like this:
request.getMethod$myproject_debug()
If I make the method field public, this stops happening. I really hope there's a way around this, since it would be a dealbreaker in switching to Kotlin if it isn't.