langtools/test/tools/javac/lambda/MostSpecific19.java
author dlsmith
Fri, 08 Jan 2016 17:02:29 -0700
changeset 34995 e4e19f521ee7
permissions -rw-r--r--
8143852: Implement type variable renaming for functional interface most specific test Reviewed-by: mcimadamore, vromero
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34995
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
     1
/*
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
     3
 * @bug 8143852
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
     4
 * @summary Test that generic function interface method bounds are the same
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
     5
 * @compile/fail/ref=MostSpecific19.out -XDrawDiagnostics MostSpecific19.java
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
     6
 */
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
     7
class MostSpecific19 {
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
     8
    interface F1 { <X extends Number> Object apply(X arg); }
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
     9
    interface F2 { <Y extends Integer> String apply(Y arg); }
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    10
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    11
    static void m1(F1 f) {}
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    12
    static void m1(F2 f) {}
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    13
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    14
    static String foo(Object in) { return "a"; }
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    15
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    16
    void test() {
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    17
        m1(MostSpecific19::foo);
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    18
    }
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    19
e4e19f521ee7 8143852: Implement type variable renaming for functional interface most specific test
dlsmith
parents:
diff changeset
    20
}