diff -r 000000000000 -r 959103a6100f test/tools/javac/varargs/6993978/T6993978neg.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/varargs/6993978/T6993978neg.java Wed Apr 27 01:34:52 2016 +0800 @@ -0,0 +1,17 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6993978 + * @author mcimadamore + * @summary ClassCastException occurs in assignment expressions without any heap pollutions + * @compile/fail/ref=T6993978neg.out -Xlint:unchecked -Werror -XDrawDiagnostics T6993978neg.java + */ + +import java.util.List; + +class T6993978neg { + @SuppressWarnings({"varargs","unchecked"}) + static void m(X... x) { } + static void test(List ls) { + m(ls); //compiler should still give unchecked here + } +}