Without this PR, method return types were inferred as any, so the method.returns(Type) decorator allowed the method to return any type. Now, the return type has to match the Type value
Is this a breaking change? (no)
In my opinion, generic type parameter changes are a grey area, and we should decide case-by-case whether we consider them breaking the API:
In most cases, the intention is for the type parameter to be inferred, not to be passed in explicitly. This is especially the case when the generic type signature is very complex and you wouldn't expect anyone to try to make it explicit. In that case, I would consider the type params not public API
In some cases where type parameters are designed to be / in practice are passed in explicitly, we should consider them public API and apply semver to them
I'm confident that we can consider this change as an example of the first case, and consider this not a breaking change.
Without this PR, method return types were inferred as
any
, so themethod.returns(Type)
decorator allowed the method to return any type. Now, the return type has to match theType
valueIs this a breaking change? (no)
In my opinion, generic type parameter changes are a grey area, and we should decide case-by-case whether we consider them breaking the API:
I'm confident that we can consider this change as an example of the first case, and consider this not a breaking change.