products/sources/formale Sprachen/Coq/doc/common/styles/html/coqremote/modules/system image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: GetParent.java   Sprache: Unknown

/*
 * @test /nodynamiccopyright/
 * @bug 8003280
 * @summary Add lambda tests
 *  crash when incompatible method reference is found in conditional expression
 * @compile/fail/ref=TargetType33.out -XDrawDiagnostics TargetType33.java
 */


class TargetType33 {

    interface A<X> {
        X m();
    }

    void m(A<Integer> a) { }
    <Z> void m2(A<Z> a) { }

    int intRes(Object o) { return 42; }

    void testMethodRef(boolean flag) {
        A<Integer> c = flag ? this::intRes : this::intRes;
        m(flag ? this::intRes : this::intRes);
        m2(flag ? this::intRes : this::intRes);
    }
}

[ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ]