Sat, 17 Nov 2012 19:01:03 +0000
8003280: Add lambda tests
Summary: Turn on lambda expression, method reference and default method support
Reviewed-by: jjg
mcimadamore@122 | 1 | /** |
jjg@384 | 2 | * @test /nodynamiccopyright/ |
mcimadamore@122 | 3 | * @bug 6747671 |
mcimadamore@122 | 4 | * @summary -Xlint:rawtypes |
mcimadamore@122 | 5 | * @compile/ref=T6747671.out -XDrawDiagnostics -Xlint:rawtypes T6747671.java |
mcimadamore@122 | 6 | */ |
mcimadamore@122 | 7 | |
mcimadamore@122 | 8 | |
mcimadamore@122 | 9 | class T6747671<E> { |
mcimadamore@122 | 10 | |
mcimadamore@122 | 11 | static class B<X> {} |
mcimadamore@122 | 12 | |
mcimadamore@122 | 13 | class A<X> { |
mcimadamore@122 | 14 | class X {} |
mcimadamore@122 | 15 | class Z<Y> {} |
mcimadamore@122 | 16 | } |
mcimadamore@122 | 17 | |
mcimadamore@122 | 18 | |
mcimadamore@122 | 19 | A.X x1;//raw warning |
mcimadamore@122 | 20 | A.Z z1;//raw warning |
mcimadamore@122 | 21 | |
mcimadamore@122 | 22 | T6747671.B<Integer> b1;//ok |
mcimadamore@122 | 23 | T6747671.B b2;//raw warning |
mcimadamore@122 | 24 | |
mcimadamore@122 | 25 | A<String>.X x2;//ok |
mcimadamore@122 | 26 | A<String>.Z<Integer> z2;//ok |
mcimadamore@122 | 27 | A<B>.Z<A<B>> z3;//raw warning (2) |
mcimadamore@122 | 28 | |
mcimadamore@122 | 29 | void test(Object arg1, B arg2) {//raw warning |
mcimadamore@638 | 30 | boolean b = arg1 instanceof A;//ok |
mcimadamore@638 | 31 | Object a = (A)arg1;//ok |
mcimadamore@122 | 32 | A a2 = new A() {};//raw warning (2) |
mcimadamore@122 | 33 | a2.new Z() {};//raw warning |
mcimadamore@122 | 34 | } |
jjg@384 | 35 | } |