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

Wed, 11 Apr 2012 10:50:11 +0100

author
mcimadamore
date
Wed, 11 Apr 2012 10:50:11 +0100
changeset 1251
6f0ed5a89c25
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

7154127: Inference cleanup: remove bound check analysis from visitors in Types.java
Summary: Remove bound checking rules from recursive subtype visitors in Types.java and replace with centralized bound-checking logic
Reviewed-by: jjg, dlsmith

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

mercurial