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

Mon, 21 Jan 2013 20:13:56 +0000

author
mcimadamore
date
Mon, 21 Jan 2013 20:13:56 +0000
changeset 1510
7873d37f5b37
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8005244: Implement overload resolution as per latest spec EDR
Summary: Add support for stuck expressions and provisional applicability
Reviewed-by: jjg

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