|
Relates :
|
|
|
Relates :
|
|
|
Relates :
|
abstract class A2<T>{
abstract <S> S pick(S x, S y);
abstract <S1> void m(A2<S1> a)
void test(A2<Integer> y, A2<Long> x){
m(pick(x, y));
}
}
Even though the return type of 'pick' is not wildcard-parameterized, for certain instantiations it can be. The greedy inference strategy of JLS 7 would then perform capture on the instantiated return type before performing inference for 'm'. The Lambda Spec instead skips capture (see 18.5.2) and produces an error.
|