Skip to content

Conversation

@davejmurphy
Copy link

I've updated the api-guidelines-backward-compatibility.md doc to clarify that manual overloads should be used to maintain binary compatibility and I replaced the recommendation about using @JvmOverloads with a caution statement.

The current documentation's statements about using@JvmOverloads to maintain binary compatibility are incorrect. The example given was also flawed, binary compatibility will be preserved when going from no default parameters to adding the first default parameter to the end of the signature, but if a second default parameter is added then binary compatibility will break.

I tried to clarify in my proposed changes why this breaks binary compatibility. There's a KEEP proposal for an @IntroducedAt annotation that will address these problems, and the proposal itself provides some more explanation of the binary compatibility problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant