new inference: exact method reference is not pertinent to applicability when target type is type parameter

(cherry picked from commit 8b3512a097ef1124a5cede6ade95b4e50017c7b9)
This commit is contained in:
Anna Kozlova
2014-03-12 10:13:19 +01:00
parent f64d2394d2
commit 0f40eb9bed
3 changed files with 59 additions and 14 deletions
@@ -0,0 +1,30 @@
import java.util.*;
class Test {
{
List<UnaryOperator<String>> a = asList(String::intern);
}
public static <Ta> List<Ta> asList(Ta a) {
return null;
}
interface UnaryOperator<T> {
T apply(T t);
}
}
class TestVarargs {
{
List<UnaryOperator<String>> a = asList(String::intern);
}
public static <Ta> List<Ta> asList(Ta... a) {
return null;
}
interface UnaryOperator<T> {
T apply(T t);
}
}