3 ms·
What counts a breaking change? I would say that strictly speaking anything could be a breaking change if an user is crazy enough, so increasing major version al
by GlitchMr 8y ago
What counts a breaking change? I would say that strictly speaking anything could be a breaking change if an user is crazy enough, so increasing major version all the time is not particularly useful - I mean, you could do that, but what is the purpose of semver then. Consider a following function.
f(arg: String): Output
Now, let's say that we change it to be generic. Let's assume that `String` implements `SomeInterface<Output>`.
f<T: SomeInterface<U>, U>(arg: T): U
An user is crazy and passed an empty generic type list and their code broke as there are now two generic arguments instead of none.
f<>("a")
Or for a different example, let's say that you want to introduce a new function, `g`, but the user does the following.
import yourlibrary.*
import otherlibrary.*
An user is using the function `g` from `otherlibrary`, and their code doesn't compile anymore due to an ambiguity.
I would say it's a minor change, but in theory it's possible for it to be a breaking change. I often had situations like this where something could be breaking, but the code had to be really unusual for it to break (and if it would break, it would be a compilation error).