test/tools/javac/lambda/8021567/T8021567.java

Mon, 16 Sep 2013 14:13:44 +0200

author
jlahoda
date
Mon, 16 Sep 2013 14:13:44 +0200
changeset 2028
4ce8148ffc4f
parent 0
959103a6100f
permissions
-rw-r--r--

8021112: Spurious unchecked warning reported by javac
6480588: No way to suppress deprecation warnings when implementing deprecated interface
Summary: Fixing DeferredLintHandler configuration, so lint warnings are reported with correct @SuppressWarnings settings
Reviewed-by: jjg, vromero

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug 8021567
     4  * @summary Javac doesn't report "java: reference to method is ambiguous" any more
     5  * @compile/fail/ref=T8021567.out -XDrawDiagnostics T8021567.java
     6  */
     8 class T8021567 {
    10     interface I_int { int m(); }
    12     interface I_char { char m(); }
    14     interface I_byte { byte m(); }
    16     void m(I_byte b) { }
    17     void m(I_char b) { }
    18     void m(I_int b) { }
    20     void test() {
    21         m(() -> 1); //ambiguous
    22         m(() -> 256); //ok - only method(I_int) applicable
    23         m(() -> { int i = 1; return i; }); //ok - only method(I_int) applicable
    24         m(() -> { int i = 256; return i; }); //ok - only method(I_int) applicable
    25     }
    26 }

mercurial