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
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
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
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