mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 16:39:37 +07:00
method reference: proceed with class type when diamond static factory is used (IDEA-93099)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import java.util.*;
|
||||
|
||||
interface Factory<T> {
|
||||
T create();
|
||||
}
|
||||
|
||||
class LambdaTest {
|
||||
|
||||
public void testR() {
|
||||
Map<String, Map<String, Counter>> map =
|
||||
new ComputeMap<String, Map<String, Counter>>(() ->
|
||||
new ComputeMap<>(Counter::new));
|
||||
|
||||
}
|
||||
|
||||
public static class ComputeMap<K, V> extends HashMap<K, V> {
|
||||
public ComputeMap(Factory<V> factory) {
|
||||
}
|
||||
}
|
||||
|
||||
public static class Counter {
|
||||
|
||||
public Counter() {
|
||||
this(0);
|
||||
}
|
||||
|
||||
public Counter(int count) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user