langtools/test/tools/javac/lambda/SourceLevelTest.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

/*
 * @test /nodynamiccopyright/
 * @bug 8003280
 * @summary Add lambda tests
 *  check that lambda features are not enabled with source < 8
 * @compile/fail/ref=SourceLevelTest.out -XDrawDiagnostics -source 7 SourceLevelTest.java
 */

class SourceLevelTest {
    interface I {
        default void m() { SourceLevelTest.impl(this); }
    }

    interface SAM {
        void m();
    }

    SAM s1 = () -> { };
    SAM s2 = this::m;

    static void impl(I i) {}
    void m() {}
}