author | duke |
Wed, 05 Jul 2017 23:01:50 +0200 (2017-07-05) | |
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=MostSpecific30.out -XDrawDiagnostics MostSpecific30.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 MostSpecific30 { |
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 Pred<T> { boolean test(T arg); } |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
10 |
interface Fun<T,R> { R apply(T arg); } |
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 |
static void m1(Pred<? extends Integer> f) {} |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
13 |
static void m1(Fun<Integer, Boolean> f) {} |
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 |
void test() { |
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
16 |
m1((Integer n) -> true); |
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 |
|
5b15a5ed3b0d
8144767: Fix handling of capture variables in most-specific test
dlsmith
parents:
diff
changeset
|
19 |
} |