langtools/test/tools/javac/lambda/MethodReference54.java
author mcimadamore
Tue, 12 Mar 2013 16:02:13 +0000
changeset 16340 3c0af3413e0f
parent 14547 86d8d242b0c4
permissions -rw-r--r--
8008540: Constructor reference to non-reifiable array should be rejected 8008539: Spurious error when constructor reference mention an interface type 8008538: Constructor reference accepts wildcard parameterized types Summary: Overhaul of Check.checkConstructorRefType 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
 *  method call with bad qualifier generates NPE if argument is a method reference
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     6
 * @compile/fail/ref=MethodReference54.out -XDrawDiagnostics MethodReference54.java
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     7
 */
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     8
class MethodReference54 {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
     9
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    10
    interface SAM {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    11
        void m();
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    12
    }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    13
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    14
    void test() {
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    15
        nonExistent.m(MethodReference54::get);
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    16
    }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    17
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    18
    static String get() { return ""; }
86d8d242b0c4 8003280: Add lambda tests
mcimadamore
parents:
diff changeset
    19
}