author | mcimadamore |
Wed, 26 Oct 2016 15:41:25 +0100 | |
changeset 41856 | 13a056e8f16e |
parent 19929 | 39df7cd8039a |
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/ |
14547 | 3 |
* @bug 8003280 |
4 |
* @summary Add lambda tests |
|
5 |
* check that raw qualifier in unbound method reference is inferred from descriptor |
|
19914 | 6 |
* @compile/fail/ref=MethodReference48.out -XDrawDiagnostics MethodReference48.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 MethodReference48 { |
10 |
||
11 |
static class Foo<X> { |
|
12 |
X m() { return null; }; |
|
13 |
} |
|
14 |
||
15 |
interface SAM1 { |
|
16 |
Foo<Object> m(Foo<String> fs); |
|
17 |
} |
|
18 |
||
19 |
interface SAM2 { |
|
20 |
Integer m(Foo<Integer> fi); |
|
21 |
} |
|
22 |
||
23 |
interface SAM3 { |
|
24 |
Object m(Foo<Integer> fi); |
|
25 |
} |
|
26 |
||
19914 | 27 |
static void g1(SAM1 s) { } //return type not compatible |
28 |
||
29 |
static void g2(SAM2 s) { } //ok |
|
30 |
||
31 |
static void g3(SAM3 s) { } //ok |
|
32 |
||
33 |
static void g4(SAM1 s) { } //return type not compatible |
|
34 |
static void g4(SAM2 s) { } //ok |
|
35 |
static void g4(SAM3 s) { } //ok |
|
14547 | 36 |
|
37 |
public static void main(String[] args) { |
|
19914 | 38 |
g1(Foo::m); |
39 |
g2(Foo::m); |
|
40 |
g3(Foo::m); |
|
41 |
g4(Foo::m); |
|
14547 | 42 |
} |
43 |
} |