MostSpecific30.java revision 3469:0bf0d57dfdfa
11573Srgrimes/* 21573Srgrimes * @test /nodynamiccopyright/ 31573Srgrimes * @bug 8144767 41573Srgrimes * @summary Correct most-specific test when wildcards appear in functional interface type 51573Srgrimes * @compile/fail/ref=MostSpecific30.out -XDrawDiagnostics MostSpecific30.java 61573Srgrimes */ 71573Srgrimesclass MostSpecific30 { 81573Srgrimes 91573Srgrimes interface Pred<T> { boolean test(T arg); } 101573Srgrimes interface Fun<T,R> { R apply(T arg); } 111573Srgrimes 121573Srgrimes static void m1(Pred<? extends Integer> f) {} 131573Srgrimes static void m1(Fun<Integer, Boolean> f) {} 141573Srgrimes 151573Srgrimes void test() { 161573Srgrimes m1((Integer n) -> true); 171573Srgrimes } 181573Srgrimes 191573Srgrimes} 201573Srgrimes