mcimadamore@1415: /* mcimadamore@1415: * @test /nodynamiccopyright/ mcimadamore@1415: * @bug 8003280 mcimadamore@1415: * @summary Add lambda tests mcimadamore@1415: * compiler crashes during flow analysis as it fails to report diagnostics during attribution mcimadamore@1510: * @compile TargetType45.java mcimadamore@1415: */ mcimadamore@1415: class TargetType45 { mcimadamore@1415: mcimadamore@1415: interface Predicate { mcimadamore@1415: boolean apply(X x); mcimadamore@1415: } mcimadamore@1415: mcimadamore@1415: interface Mapper { mcimadamore@1415: Y apply(X x); mcimadamore@1415: } mcimadamore@1415: mcimadamore@1415: class Foo { mcimadamore@1415: Foo filter(Predicate p) { return null; } mcimadamore@1415: } mcimadamore@1415: mcimadamore@1415: static Predicate compose(Predicate pi, Mapper m) { return null; } mcimadamore@1415: mcimadamore@1415: static Predicate isOdd = i -> i % 2 != 0; mcimadamore@1415: mcimadamore@1415: void top10Counties(Foo foos) { mcimadamore@1415: foos.filter(compose(isOdd, (String e) -> e.length())); mcimadamore@1415: } mcimadamore@1415: }