author | mcimadamore |
Wed, 26 Oct 2016 15:41:25 +0100 | |
changeset 41856 | 13a056e8f16e |
parent 30014 | fc1f2b200c1f |
permissions | -rw-r--r-- |
14547 | 1 |
/* |
19929
39df7cd8039a
8024154: Fix for 8016177: structural most specific and stuckness breaks 6 langtools tests
vromero
parents:
19914
diff
changeset
|
2 |
* @test /nodynamiccopyright/ |
30014
fc1f2b200c1f
8078024: javac, several incorporation steps are silently failing when an error should be reported
vromero
parents:
19929
diff
changeset
|
3 |
* @bug 8003280 8078024 |
14547 | 4 |
* @summary Add lambda tests |
5 |
* check that generic method reference is inferred when type parameters are omitted |
|
19914 | 6 |
* @compile/fail/ref=MethodReference46.out -XDrawDiagnostics MethodReference46.java |
14547 | 7 |
*/ |
19929
39df7cd8039a
8024154: Fix for 8016177: structural most specific and stuckness breaks 6 langtools tests
vromero
parents:
19914
diff
changeset
|
8 |
|
14547 | 9 |
public class MethodReference46 { |
10 |
||
11 |
interface SAM1 { |
|
12 |
void m(String s); |
|
13 |
} |
|
14 |
||
15 |
interface SAM2 { |
|
16 |
void m(Integer s); |
|
17 |
} |
|
18 |
||
19 |
interface SAM3 { |
|
20 |
void m(Object o); |
|
21 |
} |
|
22 |
||
23 |
static class Foo<X extends Number> { |
|
24 |
Foo(X x) { } |
|
25 |
} |
|
26 |
||
27 |
static <X extends Number> void m(X fx) { } |
|
28 |
||
19914 | 29 |
static void g1(SAM1 s) { } |
30 |
||
31 |
static void g2(SAM2 s) { } |
|
32 |
||
33 |
static void g3(SAM3 s) { } |
|
34 |
||
35 |
static void g4(SAM1 s) { } |
|
36 |
static void g4(SAM2 s) { } |
|
37 |
static void g4(SAM3 s) { } |
|
14547 | 38 |
|
39 |
public static void main(String[] args) { |
|
19914 | 40 |
g1(MethodReference46::m); |
41 |
g2(MethodReference46::m); |
|
42 |
g3(MethodReference46::m); |
|
43 |
g4(MethodReference46::m); |
|
14547 | 44 |
} |
45 |
} |