test/langtools/tools/javac/Ambig3.java
author dmarkov
Mon, 23 Sep 2019 17:18:03 +0100
changeset 58328 fe46ee1d42ee
parent 47216 71c04702a3d5
permissions -rw-r--r--
8230782: Robot.createScreenCapture() fails if “awt.robot.gtk” is set to false Reviewed-by: prr, serb

/*
 * @test /nodynamiccopyright/
 * @bug 4906586
 * @summary Missing ambiguity error when two methods are equally specific
 * @author gafter
 *
 * @compile/fail/ref=Ambig3.out -XDrawDiagnostics  Ambig3.java
 */

class Test<T,E> {
    public void check(T val){
        System.out.println("Second check method being called");
    }
    public E check(E val){
        System.out.println("First check method being called");
        return null;
    }
 }

class Test3 extends Test<String,String> { }

class ParametericMethodsTest3 {
      public void assertion2() {
            Test3 tRef = new Test3();
            tRef.check("");
      }
 }