author | duke |
Wed, 05 Jul 2017 23:01:50 +0200 | |
changeset 44228 | e46434c65a2b |
parent 38913 | 5b15a5ed3b0d |
permissions | -rw-r--r-- |
38913
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
1 |
/* |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
2 |
* @test /nodynamiccopyright/ |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
3 |
* @bug 8144767 |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
4 |
* @summary Correct most-specific test when wildcards appear in functional interface type |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
5 |
* @compile/fail/ref=MostSpecific32.out -XDrawDiagnostics MostSpecific32.java |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
6 |
*/ |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
7 |
class MostSpecific32 { |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
8 |
|
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
9 |
interface A<T> {} |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
10 |
interface B<T> extends A<T> {} |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
11 |
|
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
12 |
interface F1<S> { A<S> apply(); } |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
13 |
interface F2<S> { B<S> apply(); } |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
14 |
|
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
15 |
static void m1(F1<? extends Number> f1) {} |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
16 |
static void m1(F2<? extends Number> f2) {} |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
17 |
|
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
18 |
void test() { |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
19 |
m1(() -> null); // B<CAP ext Number> </: A<Number> |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
20 |
} |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
21 |
|
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
22 |
} |