|
1 /* |
|
2 * @test /nodynamiccopyright/ |
|
3 * @bug 8003280 |
|
4 * @summary Add lambda tests |
|
5 * bad stuck check for method reference leads to javac crash |
|
6 * @compile/fail/ref=TargetType50.out -XDrawDiagnostics TargetType50.java |
|
7 */ |
|
8 import java.util.*; |
|
9 |
|
10 class TargetType50 { |
|
11 |
|
12 interface Factory<F> { |
|
13 F make(); |
|
14 } |
|
15 |
|
16 static class Sink<T> { |
|
17 static <Z> Sink<Z> make() { return null; } |
|
18 } |
|
19 |
|
20 <Y, S extends Sink<Y>> List<Y> m(Factory<S> factory) { } |
|
21 |
|
22 void test() { |
|
23 List<?> l1 = m(Sink::new); |
|
24 List<?> l2 = m(Sink::make); |
|
25 List<String> l3 = m(Sink::new); |
|
26 List<String> l4 = m(Sink::make); |
|
27 } |
|
28 } |