Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8021567

Javac doesn't report "java: reference to method is ambiguous" any more

XMLWordPrintable

    • Verified

        The compilation of the following code sample fails on b94:

        -----------------------------------------------------------------
            public static void main(String argv[]) {
                method(() -> true ? ((int) 2) : ((int) 3));
            }

            interface I_int { int method(); }
            static void method(I_int i_int) {
            }

            interface I_char { char method(); }
            static void method(I_char i_char) {
            }

            interface I_byte { byte method(); }
            static void method(I_byte i_byte) {
            }

        java: reference to method is ambiguous
          both method method(lmbd086.I_char) in lmbd086 and method method(lmbd086.I_byte) in lmbd086 match
        -----------------------------------------------------------------

        But it compiles with b98, b100

        The following JCK tests fail due to this issue:

        lang/LMBD/lmbd086/lmbd08602m0/lmbd08602m0.html: Failed. compilation did not fail as expected
        lang/LMBD/lmbd086/lmbd08602m03/lmbd08602m03.html: Failed. compilation did not fail as expected
        lang/LMBD/lmbd086/lmbd08602m01/lmbd08602m01.html: Failed. compilation did not fail as expected
        lang/LMBD/lmbd086/lmbd08602m02/lmbd08602m02.html: Failed. compilation did not fail as expected
        lang/LMBD/lmbd086/lmbd08602m13/lmbd08602m13.html: Failed. compilation did not fail as expected
        lang/LMBD/lmbd086/lmbd08602m11/lmbd08602m11.html: Failed. compilation did not fail as expected
        lang/LMBD/lmbd086/lmbd08602m12/lmbd08602m12.html: Failed. compilation did not fail as expected
        lang/LMBD/lmbd086/lmbd08602m1/lmbd08602m1.html: Failed. compilation did not fail as expected




              mcimadamore Maurizio Cimadamore
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: