Was the feature to add @JvmOverloads to copy metho...
# random
o
Was the feature to add @JvmOverloads to copy method was already asked? I am having issues with data class compatibility: https://github.com/jasync-sql/jasync-sql/issues/359
e
data classes are challenging to evolve with API/ABI compatibility. the constructor also changes, as do
componentN()
destructuring
o
yes... but constructor have jvm overloads and I only add new fields. I think only the copy is an issue in such case
but maybe I should open a new request for it?
e
@JvmOverloads
only addresses Java compatibility. Kotlin calls don't use the generated overloads so any change to the data class is binary incompatible for Kotlin (unless you write the overloads manually), whether you have
@JvmOverloads
or not.
o
For my original issue I change it to non data class and wrote the copy myself.
e
my point is that
@JvmOverloads constructor()
and
@JvmOverloads fun copy()
still break binary compatibility for Kotlin callers when arguments are added, regardless of
data class
or not
o
that's unfortunate