langtools/test/tools/javac/lambda/MethodReference21.java
author mcimadamore
Wed, 26 Oct 2016 15:41:25 +0100
changeset 41856 13a056e8f16e
parent 14547 86d8d242b0c4
permissions -rw-r--r--
8168774: Polymorhic signature method check crashes javac Summary: Check for polysig method assumes arity is greater than zero Reviewed-by: vromero
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 that erroneous method references are flagged with errors as expected
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     6
 * @author  Maurizio Cimadamore
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     7
 * @compile/fail/ref=MethodReference21.out -XDrawDiagnostics MethodReference21.java
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     8
 */
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     9
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    10
class MethodReference21 {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    11
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    12
    interface SAM {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    13
        void m();
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    14
    }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    15
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    16
    void call(SAM s) {}
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    17
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    18
    SAM s = NonExistentType::m;
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    19
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    20
    {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    21
        call(NonExistentType::m);
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    22
    }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    23
}