mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
diamonds: accept captured types; discard anonymous inner classes (IDEA-67125)
This commit is contained in:
+3
-18
@@ -1,20 +1,5 @@
|
||||
class Neg08 {
|
||||
static class Foo<X> {
|
||||
Foo(X x) { }
|
||||
}
|
||||
|
||||
static class DoubleFoo<X,Y> {
|
||||
DoubleFoo(X x,Y y) { }
|
||||
}
|
||||
|
||||
static class TripleFoo<X,Y,Z> {
|
||||
TripleFoo(X x,Y y,Z z) { }
|
||||
}
|
||||
|
||||
Foo<? extends Integer> fi = new Foo<>(1);
|
||||
Foo<?> fw = new Foo<<error descr="Cannot infer type arguments for Foo<> because type Foo<? extends Integer> inferred is not allowed in current context"></error>>(fi);
|
||||
Foo<? extends Double> fd = new Foo<>(3.0);
|
||||
DoubleFoo<?,?> dw = new DoubleFoo<<error descr="Cannot infer type arguments for DoubleFoo<> because type Foo<? extends Integer> inferred is not allowed in current context"></error>>(fi,fd);
|
||||
Foo<String> fs = new Foo<>("one");
|
||||
TripleFoo<?,?,?> tw = new TripleFoo<<error descr="Cannot infer type arguments for TripleFoo<> because type Foo<? extends Integer> inferred is not allowed in current context"></error>>(fi,fd,fs);
|
||||
public static void main(String[] args) {
|
||||
String s = new String<<error descr="Diamond operator is not applicable for non-parameterized types"></error>>("foo");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user