mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
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:
+30
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user