2010-07-22 18:02:54 +00:00
|
|
|
/*
|
2020-12-30 17:20:54 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2012-11-17 19:01:03 +00:00
|
|
|
* @bug 8003280
|
|
|
|
* @summary Add lambda tests
|
2013-01-21 20:13:56 +00:00
|
|
|
* check that non-boxing method references is not preferred over boxing one
|
|
|
|
* @compile/fail/ref=MethodReference25.out -XDrawDiagnostics MethodReference25.java
|
2012-11-17 19:01:03 +00:00
|
|
|
*/
|
|
|
|
|
2013-01-21 20:13:56 +00:00
|
|
|
class MethodReference25 {
|
2012-11-17 19:01:03 +00:00
|
|
|
|
2013-01-21 20:13:56 +00:00
|
|
|
static void m(Integer i) { }
|
2012-11-17 19:01:03 +00:00
|
|
|
|
|
|
|
interface SAM1 {
|
|
|
|
void m(int x);
|
|
|
|
}
|
|
|
|
|
|
|
|
interface SAM2 {
|
|
|
|
void m(Integer x);
|
|
|
|
}
|
|
|
|
|
2013-01-21 20:13:56 +00:00
|
|
|
static void call(int i, SAM1 s) { s.m(i); }
|
2012-11-17 19:01:03 +00:00
|
|
|
static void call(int i, SAM2 s) { s.m(i); }
|
2010-07-22 18:02:54 +00:00
|
|
|
|
2023-01-17 04:43:40 +00:00
|
|
|
public static void meth() {
|
2013-01-21 20:13:56 +00:00
|
|
|
call(1, MethodReference25::m); //ambiguous
|
2010-07-22 18:02:54 +00:00
|
|
|
}
|
|
|
|
}
|