mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
diamonds: accept captured types; discard anonymous inner classes (IDEA-67125)
This commit is contained in:
+17
-27
@@ -1,33 +1,23 @@
|
||||
public class Pos01<X> {
|
||||
|
||||
Pos01(X x) {}
|
||||
Pos01(X x) {}
|
||||
|
||||
<Z> Pos01(X x, Z z) {}
|
||||
<Z> Pos01(X x, Z z) {}
|
||||
|
||||
void test() {
|
||||
Pos01<Integer> p1 = new Pos01<>(1); //new Foo<Integer> created
|
||||
Pos01<? extends Integer> p2 = new Pos01<>(1); //new Foo<Integer> created
|
||||
Pos01<?> p3 = new Pos01<>(1); //new Foo<Object> created
|
||||
Pos01<? super Integer> p4 = new Pos01<>(1); //new Foo<Object> created
|
||||
void test() {
|
||||
Pos01<Integer> p1 = new Pos01<>(1);
|
||||
Pos01<? extends Integer> p2 = new Pos01<>(1);
|
||||
Pos01<?> p3 = new Pos01<>(1);
|
||||
Pos01<? super Integer> p4 = new Pos01<>(1);
|
||||
|
||||
Pos01<Integer> p5 = new Pos01<>(1){}; //new Foo<Integer> created
|
||||
Pos01<? extends Integer> p6 = new Pos01<>(1){}; //new Foo<Integer> created
|
||||
Pos01<?> p7 = new Pos01<>(1){}; //new Foo<Object> created
|
||||
Pos01<? super Integer> p8 = new Pos01<>(1){}; //new Foo<Object> created
|
||||
Pos01<Integer> p5 = new Pos01<>(1, "");
|
||||
Pos01<? extends Integer> p6 = new Pos01<>(1, "");
|
||||
Pos01<?> p7 = new Pos01<>(1, "");
|
||||
Pos01<? super Integer> p8 = new Pos01<>(1, "");
|
||||
}
|
||||
|
||||
Pos01<Integer> p9 = new Pos01<>(1, ""); //new Foo<Integer> created
|
||||
Pos01<? extends Integer> p10 = new Pos01<>(1, ""); //new Foo<Integer> created
|
||||
Pos01<?> p11 = new Pos01<>(1, ""); //new Foo<Object> created
|
||||
Pos01<? super Integer> p12 = new Pos01<>(1, ""); //new Foo<Object> created
|
||||
|
||||
Pos01<Integer> p13 = new Pos01<>(1, ""){}; //new Foo<Integer> created
|
||||
Pos01<? extends Integer> p14= new Pos01<>(1, ""){}; //new Foo<Integer> created
|
||||
Pos01<?> p15 = new Pos01<>(1, ""){}; //new Foo<Object> created
|
||||
Pos01<? super Integer> p16 = new Pos01<>(1, ""){}; //new Foo<Object> created
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Pos01<String> p1 = new Pos01<>("");
|
||||
p1.test();
|
||||
}
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
Pos01<String> p1 = new Pos01<>("");
|
||||
p1.test();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user