mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
skip errors in case of diamond inference with type parameters on constructor
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
class MyTest {
|
||||
|
||||
static void createClass(Map<String, Object> templateAttributes,
|
||||
final Consumer<Integer> postProcessRunnable) {
|
||||
}
|
||||
|
||||
void f(Map<String, String> m) {
|
||||
final Ref<Integer> clazz = new Ref<>();
|
||||
createClass(
|
||||
new HashMap<>(foo(m)),
|
||||
i -> clazz.set(i)
|
||||
);
|
||||
}
|
||||
|
||||
private Map<String, String> foo(final Map<String, String> m) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private class Ref<T> {
|
||||
void set(T t) {
|
||||
}
|
||||
}
|
||||
}
|
||||
class HashMap<K, V> extends java.util.HashMap<K, V> {
|
||||
public <K1 extends K, V1 extends V> HashMap(Map<? extends K1, ? extends V1> map) {
|
||||
super(map);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -48,7 +48,7 @@ class Test2 {
|
||||
{
|
||||
Class c = D.class;
|
||||
|
||||
D<String> d = new D<error descr="Cannot infer arguments"><></error>(s -> s.<error descr="Cannot resolve method 'isEmpty()'">isEmpty</error>(), c);
|
||||
D<String> d = new D<>(s -> s.<error descr="Cannot resolve method 'isEmpty()'">isEmpty</error>(), c);
|
||||
D<String> d1 = D.create(s -> s.<error descr="Cannot resolve method 'isEmpty()'">isEmpty</error>(), c);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user