view test/tools/javac/generics/inference/6315770/T6315770.java @ 4081:cd6eb36db1bb jdk8u292-b05

8078024: javac, several incorporation steps are silently failing when an error should be reported Reviewed-by: phh, andrew
author peterz
date Wed, 22 Apr 2015 09:44:15 -0700
parents ed31953ca025
children
line wrap: on
line source

/**
 * @test /nodynamiccopyright/
 * @bug     6315770 8078024
 * @summary javac inference allows creation of strange types: Integer & Runnable
 * @author Maurizio Cimadamore
 *
 * @compile/fail/ref=T6315770.out T6315770.java -XDrawDiagnostics
 */

class T6315770<V> {
    <T extends Integer & Runnable> T6315770<T> m() {
        return null;
    }
    void test() {
        T6315770<?> c1 = m();
        T6315770<? extends String> c2 = m();
        T6315770<? super String> c3 = m();
    }
}