langtools/test/tools/javac/BadCovar.java
author prr
Mon, 13 Oct 2014 09:09:41 -0700 (2014-10-13)
changeset 27274 62de2c957523
parent 26274 02a5b23ee21c
permissions -rw-r--r--
8059848: Test java/awt/GraphicsDevice/CloneConfigsTest.java causes JVM crash in OEL 7.0 Reviewed-by: bae, serb
/*
 * @test /nodynamiccopyright/
 * @bug 5007379
 * @summary Compiler allows inheritance of multiple methods with unrelated return types
 * @author gafter
 *
 * @compile/fail/ref=BadCovar.out -XDrawDiagnostics  BadCovar.java
 */

package bad.covar;

import java.util.*;

interface A{
        List<? extends A> f();
}

interface B{
        List<? extends B> f();
}

abstract class C implements A, B {} // should give error