test/tools/javac/varargs/6993978/T6993978neg.java

Wed, 06 Apr 2011 20:33:44 -0700

author
ohair
date
Wed, 06 Apr 2011 20:33:44 -0700
changeset 962
0ff2bbd38f10
parent 0
959103a6100f
permissions
-rw-r--r--

7033660: Update copyright year to 2011 on any files changed in 2011
Reviewed-by: dholmes

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug     6993978
     4  * @author mcimadamore
     5  * @summary  ClassCastException occurs in assignment expressions without any heap pollutions
     6  * @compile/fail/ref=T6993978neg.out -Xlint:unchecked -Werror -XDrawDiagnostics T6993978neg.java
     7  */
     9 import java.util.List;
    11 class T6993978neg {
    12    @SuppressWarnings({"varargs","unchecked"})
    13    static <X> void m(X... x) {  }
    14    static void test(List<String> ls) {
    15        m(ls); //compiler should still give unchecked here
    16    }
    17 }

mercurial