test/tools/javac/cast/6467183/T6467183a.java

Thu, 21 Feb 2013 14:43:51 -0800

author
rfield
date
Thu, 21 Feb 2013 14:43:51 -0800
changeset 1601
cd7340a84bb8
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8008405: Now that metafactory is in place, add javac lambda serialization tests
Summary: Tests part of original langtools serialization review.
Reviewed-by: mcimadamore

mcimadamore@235 1 /*
jjg@384 2 * @test /nodynamiccopyright/
mcimadamore@235 3 * @author mcimadamore
mcimadamore@235 4 * @bug 6467183
mcimadamore@235 5 * @summary
mcimadamore@235 6 * @compile/fail/ref=T6467183a.out -Xlint:unchecked -Werror -XDrawDiagnostics T6467183a.java
mcimadamore@235 7 */
mcimadamore@235 8
mcimadamore@235 9 class T6467183a<T> {
mcimadamore@235 10
mcimadamore@235 11 class A<S> {}
mcimadamore@235 12 class B extends A<Integer> {}
mcimadamore@235 13 class C<X> extends A<X> {}
mcimadamore@235 14
mcimadamore@235 15 void cast1(B b) {
mcimadamore@235 16 Object o = (A<T>)b;
mcimadamore@235 17 }
mcimadamore@235 18
mcimadamore@235 19 void cast2(B b) {
mcimadamore@235 20 Object o = (A<? extends Number>)b;
mcimadamore@235 21 }
mcimadamore@235 22
mcimadamore@235 23 void cast3(A<Integer> a) {
mcimadamore@235 24 Object o = (C<? extends Number>)a;
mcimadamore@235 25 }
mcimadamore@235 26
mcimadamore@235 27 void cast4(A<Integer> a) {
mcimadamore@235 28 Object o = (C<? extends Integer>)a;
mcimadamore@235 29 }
mcimadamore@235 30 }

mercurial