langtools/test/tools/javac/lambda/speculative/8154180/T8154180b.java
author mcimadamore
Mon, 16 May 2016 14:51:17 +0100
changeset 38512 c71e1cdd6674
permissions -rw-r--r--
8154180: Regression: stuck expressions do not behave correctly Summary: ArgumentAttr should not cache stuck trees Reviewed-by: vromero

/*
 * @test /nodynamiccopyright/
 * @bug 8154180
 * @summary Regression: stuck expressions do not behave correctly
 * @compile/fail/ref=T8154180b.out -XDrawDiagnostics T8154180b.java
 */
class T8154180b {
    interface Foo1 {
       Object m(String s);
    }

    interface Foo2 {
       String m(String s);
    }


    void m(Foo1 f1) { }
    void m(Foo2 f2) { }

    void test() {
        m(x->"");
        m((x->""));
        m(true ? x -> "" : x -> "");
        m((true ? x -> "" : x -> ""));
        m((true ? (x -> "") : (x -> "")));
    }
}