Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8007626

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8
    • 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
      }

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

              Created:
              Updated:
              Resolved: