mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
moreSpecific simplification, include complete check for inferred types in MethodCandidateInfo.isApplicable
This commit is contained in:
+1
-1
@@ -12,6 +12,6 @@ class B
|
||||
{
|
||||
public static void main(String[] args) {
|
||||
A a = null;
|
||||
a.foo<error descr="Ambiguous method call: both 'A.foo(Collection<?>)' and 'A.foo(List<?>)' match">(null)</error>;
|
||||
a.foo<error descr="Ambiguous method call: both 'A.foo(List<?>)' and 'A.foo(List<?>)' match">(null)</error>;
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package pck;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static pck.C.foo;
|
||||
import static pck.C.foo1;
|
||||
import static pck.D.foo;
|
||||
import static pck.D.foo1;
|
||||
|
||||
class C {
|
||||
static <T> void foo(List<T> x) { }
|
||||
static <T extends List> void foo1(List<T> x) { }
|
||||
}
|
||||
|
||||
class D {
|
||||
static <T extends List<S>, S> String foo(List<T> x) { return null; }
|
||||
static <T extends List<?>, S> String foo1(List<T> x) { return null; }
|
||||
}
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args){
|
||||
List<List<String>> x = null;
|
||||
foo(x).toCharArray();
|
||||
foo1(x).toCharArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user