My company maintains a large API and ABI stable platform written entirely in Kotlin. One feature causing us pain at the moment is that adding new default parameters to a method, even when annotated with
@JvmOverloads, is ABI stable only for Java clients - not Kotlin clients. The latter will break because the method call is emitted as a call to the version of the method that takes all parameters with the bitmask, and the overloads that are generated don’t provide that bitmask.
We’ve been able to work around it for now with a variety of increasingly horrible hacks, but this will pollute our codebase over time.
This is probably not too hard to fix in the compiler directly, unless there are subtleties we’ve missed. If we contribute a PR to make the compiler emit additional synthetic methods to class files to keep old binaries working in the presence of new params, will that be accepted? Is there anything we should watch out for - e.g. are you planning a rewrite of relevant areas?