diamonds: accept captured types; discard anonymous inner classes (IDEA-67125)

This commit is contained in:
anna
2011-04-20 20:10:21 +02:00
parent c0efffec17
commit b94ead9094
18 changed files with 307 additions and 432 deletions
@@ -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");
}
}