mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
more specific: lambda extended initial fix (IDEA-113357)
This commit is contained in:
+1
-1
@@ -22,6 +22,6 @@ class AmbiguityRawGenerics {
|
||||
<Z> void foo(I3<Z> s) { }
|
||||
|
||||
void bar() {
|
||||
foo<error descr="Ambiguous method call: both 'AmbiguityRawGenerics.foo(I)' and 'AmbiguityRawGenerics.foo(I1)' match">(()-> { throw new RuntimeException(); })</error>;
|
||||
foo<error descr="Ambiguous method call: both 'AmbiguityRawGenerics.foo(I)' and 'AmbiguityRawGenerics.foo(I3<Object>)' match">(()-> { throw new RuntimeException(); })</error>;
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
class A {
|
||||
private interface AsyncFunction<I, O> {
|
||||
Promise<O> apply(I input);
|
||||
}
|
||||
|
||||
private interface Function<I, O> {
|
||||
O apply(I input);
|
||||
}
|
||||
|
||||
private interface Promise<V> {
|
||||
<T1> Promise<T1> then(Function<? super V, T1> function);
|
||||
<T2> Promise<T2> then(AsyncFunction<? super V, T2> function);
|
||||
}
|
||||
|
||||
private static Promise<Integer> calculateLength(String word) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(Promise<String> helloWorld) {
|
||||
helloWorld.then(A::calculateLength);
|
||||
}
|
||||
}
|
||||
|
||||
class AAmbiguous {
|
||||
private interface AsyncFunction<I, O> {
|
||||
O apply(I input);
|
||||
}
|
||||
|
||||
private interface Function<I, O> {
|
||||
O apply(I input);
|
||||
}
|
||||
|
||||
private interface Promise<V> {
|
||||
<T1> Promise<T1> then(Function<? super V, T1> function);
|
||||
<T2> Promise<T2> then(AsyncFunction<? super V, T2> function);
|
||||
}
|
||||
|
||||
private static Promise<Integer> calculateLength(String word) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(Promise<String> helloWorld) {
|
||||
helloWorld.then<error descr="Ambiguous method call: both 'Promise.then(Function<? super String,Promise<Integer>>)' and 'Promise.then(AsyncFunction<? super String,Promise<Integer>>)' match">(AAmbiguous::calculateLength)</error>;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -95,7 +95,7 @@ class MyTest2 {
|
||||
System.out.println(i);
|
||||
}
|
||||
|
||||
private static void m(I2 i) {
|
||||
private static void <warning descr="Private method 'm(MyTest2.I2)' is never used">m</warning>(I2 i) {
|
||||
System.out.println(i);
|
||||
}
|
||||
|
||||
@@ -104,6 +104,6 @@ class MyTest2 {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
m(Foo::new);
|
||||
m<error descr="Ambiguous method call: both 'MyTest2.m(I2)' and 'MyTest2.m(I3)' match">(Foo::new)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user