test/tools/javac/lambda/TargetType23.java

changeset 2395
9c577131ffa6
parent 1415
01c9d4161882
child 2525
2eb010b6cb22
equal deleted inserted replaced
2394:89cefe38ecaf 2395:9c577131ffa6
29 void call(Sam0 s) { } 29 void call(Sam0 s) { }
30 void call(Sam1 s) { } 30 void call(Sam1 s) { }
31 void call(Sam2 s) { } 31 void call(Sam2 s) { }
32 <Z> void call(Sam3<Z> s) { } 32 <Z> void call(Sam3<Z> s) { }
33 33
34 void call2(Sam0 s) { }
35 void call2(Sam2 s) { }
36 <Z> void call2(Sam3<Z> s) { }
37
34 void test() { 38 void test() {
35 call(()-> { throw new RuntimeException(); }); //ambiguous - both call(Sam0), call(Sam2), call(Sam3) match 39 call(()-> { throw new RuntimeException(); }); // ambiguous - call(Sam1) vs. call(Sam2)
40 call2(()-> { throw new RuntimeException(); }); // ok
36 } 41 }
37 } 42 }

mercurial