langtools/test/tools/javac/lambda/MostSpecific01.java
author mcimadamore
Sat, 17 Nov 2012 19:01:03 +0000
changeset 14547 86d8d242b0c4
permissions -rw-r--r--
8003280: Add lambda tests Summary: Turn on lambda expression, method reference and default method support Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14547
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     1
/*
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     3
 * @bug 8003280
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     4
 * @summary Add lambda tests
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     5
 *  check correctness of structural most specific test routine
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=MostSpecific01.out -XDrawDiagnostics MostSpecific01.java
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     7
 */
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     8
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     9
class Test {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    10
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    11
    interface IntMapper {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    12
        int map();
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    13
    }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    14
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    15
    interface LongMapper {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    16
        long map();
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    17
    }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    18
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    19
    void m(IntMapper im, String s) { }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    20
    void m(LongMapper lm, Integer s) { }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    21
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    22
    void test() {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    23
        m(()->1, null);
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    24
    }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    25
}