Re: Bad interaction between wildcard and functional interface conversion

2015-07-05 Thread Remi Forax
On 07/05/2015 03:13 PM, Gernot Neppert wrote: Hi Remi, I think it's fair to say that I know my share of Java Generics, so I generally understand the motivation of introducing wildcards into method signatures. Just in your particular case (and in your original example), I don't see what you g

Re: Bad interaction between wildcard and functional interface conversion

2015-07-05 Thread Gernot Neppert
Hi Remi, I think it's fair to say that I know my share of Java Generics, so I generally understand the motivation of introducing wildcards into method signatures. Just in your particular case (and in your original example), I don't see what you gain by having the "super" wildcard for the oute

Re: Bad interaction between wildcard and functional interface conversion

2015-06-29 Thread Remi Forax
Bitten again by the very same issue :( The following code doesn't compile: static Function factory(ConsumerK, ? super T>> consumer, Function ifAbsent) { HashMap map = new HashMap<>(); consumer.accept(map::put); return key -> map.computeIfAbsent(key, ifAbsent); } I really think th

Bad interaction between wildcard and functional interface conversion

2015-05-27 Thread Remi Forax
Hi all, The way the conversion between a lambda (or a method reference) and a functional interface is specified doesn't take wildcard (exactly ? super) into account making the concept of contravariance of functional interface less intuitive that it should be. The following code compiles: p