Lambda: compiler fails to reject generic functional descriptor in lambda expression

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 8
    • Component/s: tools

      This should NOT compile:

      import java.util.List;
      interface A { <T> T foo(List<T> p); }
      interface B { <S> S foo(List<S> p); }
      interface C extends A, B {}

      class Z {
          C c = (p) -> { return null;}; // accepted
      }

            Assignee:
            Maurizio Cimadamore
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: