test/tools/javac/generics/inference/6315770/T6315770.java

Thu, 02 Aug 2012 18:22:41 +0100

author
mcimadamore
date
Thu, 02 Aug 2012 18:22:41 +0100
changeset 1296
cddc2c894cc6
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

7175911: Simplify error reporting API in Check.CheckContext interface
Summary: Make error messages generated during Check.checkType more uniform and more scalable
Reviewed-by: jjg, dlsmith

mcimadamore@210 1 /**
jjg@384 2 * @test /nodynamiccopyright/
mcimadamore@210 3 * @bug 6315770
mcimadamore@210 4 * @summary javac inference allows creation of strange types: Integer & Runnable
mcimadamore@210 5 * @author Maurizio Cimadamore
mcimadamore@210 6 *
mcimadamore@210 7 * @compile/fail/ref=T6315770.out T6315770.java -XDrawDiagnostics
mcimadamore@210 8 */
mcimadamore@210 9
mcimadamore@210 10 class T6315770<V> {
mcimadamore@210 11 <T extends Integer & Runnable> T6315770<T> m() {
mcimadamore@210 12 return null;
mcimadamore@210 13 }
mcimadamore@210 14 void test() {
mcimadamore@210 15 T6315770<?> c1 = m();
mcimadamore@210 16 T6315770<? extends String> c2 = m();
mcimadamore@210 17 T6315770<? super String> c3 = m();
mcimadamore@210 18 }
mcimadamore@210 19 }

mercurial