mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
lambda: stop inference from lambda if return type retrieval leads to second lambda inference; do not cache types during this calculation
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
import java.util.*;
|
||||
public class Main1 {
|
||||
|
||||
interface I<T> {
|
||||
List<T> f();
|
||||
}
|
||||
|
||||
static class Test {
|
||||
<Z> void m(I<Z> i, I<Z> ii) {
|
||||
}
|
||||
|
||||
<Z> void m(I<Z> s) {
|
||||
}
|
||||
|
||||
{
|
||||
m(() -> emptyList(), () -> new ArrayList<String>());
|
||||
m(() -> new ArrayList<String>(), () -> emptyList());
|
||||
m((I<String>) () -> emptyList(), () -> new ArrayList<String>());
|
||||
m(() -> Test.<String>emptyList(), () -> new ArrayList<String>());
|
||||
m(() -> emptyList());
|
||||
}
|
||||
|
||||
static <T> List<T> emptyList() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user