langtools/test/tools/javac/lambda/TargetType21.java
changeset 15038 3ad27d268874
parent 14547 86d8d242b0c4
child 15374 fb8f6acf09cc
equal deleted inserted replaced
15037:8ba16ac61b1a 15038:3ad27d268874
    23     void call(SAM1 sam) { }
    23     void call(SAM1 sam) { }
    24     void call(SAM2 sam) { }
    24     void call(SAM2 sam) { }
    25     <R,A> void call(SAM3<R,A> sam) { }
    25     <R,A> void call(SAM3<R,A> sam) { }
    26 
    26 
    27     void test() {
    27     void test() {
    28         call(x -> { throw new Exception(); }); //ok - resolves to call(SAM1)
    28         call(x -> { throw new Exception(); }); //ambiguous
    29         call(x -> { System.out.println(""); }); //ok - resolves to call(SAM2)
    29         call(x -> { System.out.println(""); }); //ok - resolves to call(SAM2)
    30         call(x -> { return (Object) null; }); //error - call(SAM3) is not applicable because of cyclic inference
    30         call(x -> { return (Object) null; }); //error - call(SAM3) is not applicable because of cyclic inference
    31         call(x -> { return null; }); ////ok - resolves to call(SAM1)
    31         call(x -> { return null; }); ////ok - resolves to call(SAM1)
    32     }
    32     }
    33 }
    33 }