author | lana |
Tue, 25 Apr 2017 07:38:50 +0000 | |
changeset 44909 | b53c770dc04f |
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 diamond inference is applied when using raw constructor reference qualifier |
|
19914 | 6 |
* @compile/fail/ref=MethodReference43.out -XDrawDiagnostics MethodReference43.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 MethodReference43 { |
10 |
||
11 |
interface SAM1 { |
|
12 |
Foo<?> m(String s); |
|
13 |
} |
|
14 |
||
15 |
interface SAM2 { |
|
16 |
Foo<?> m(Integer s); |
|
17 |
} |
|
18 |
||
19 |
interface SAM3 { |
|
20 |
Foo<?> m(Object o); |
|
21 |
} |
|
22 |
||
23 |
interface SAM4 { |
|
24 |
Foo<Number> m(Integer o); |
|
25 |
} |
|
26 |
||
27 |
static class Foo<X extends Number> { |
|
28 |
Foo(X x) { } |
|
29 |
} |
|
30 |
||
19914 | 31 |
static void m1(SAM1 s) { } |
14547 | 32 |
|
19914 | 33 |
static void m2(SAM2 s) { } |
34 |
||
35 |
static void m3(SAM3 s) { } |
|
36 |
||
37 |
static void m4(SAM4 s) { } |
|
38 |
||
39 |
static void m5(SAM1 s) { } |
|
40 |
static void m5(SAM2 s) { } |
|
41 |
static void m5(SAM3 s) { } |
|
42 |
static void m5(SAM4 s) { } |
|
14547 | 43 |
|
44 |
public static void main(String[] args) { |
|
19914 | 45 |
m1(Foo::new); |
46 |
m2(Foo::new); |
|
47 |
m3(Foo::new); |
|
48 |
m4(Foo::new); |
|
49 |
m5(Foo::new); |
|
14547 | 50 |
} |
51 |
} |