Hi Rémi,

On 25/06/2020 00:32, Remi Forax wrote:
I get that you want to keep Consumer<R> instead of Consumer<? super R> because Consumer<? 
super R> is not a valid target type for a lambda, but the BiConsumer should be able to take a ? super 
Consumer<R> instead of just Consumer<R>.

Though I don't dispute that a strict application of the rules of
covariance and contravariance would require to design a signature
that accepts a `? super Consumer<R>` - how would you implement a
BiConsumer with a signature that doesn't take a Consumer<R>?

Such an implementation would be unable to push anything downstream
without having to cast back the consumer to Consumer<R>.

My personal preference would be to vote in favor of the simpler
signature - which IMO is more readable and easier to understand.

best regards,

-- daniel

Reply via email to