Javac issues spurious raw type warnings when lambda has implicit parameter types

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8, 8-repo-lambda
    • Component/s: tools
    • b91
    • Verified

      The following code:

      import java.util.List;

      class Test {

          public void testRawMerge(List<String> ls) {
              R12 r12_1 = l->"Foo";
              R12 r12_2 = (List l)->"Foo";
          }

          interface R1 {
              Object m(List<String> ls);
          }

          @SuppressWarnings("rawtypes")
          interface R2 {
              String m(List l);
          }

          interface R12 extends R1, R2 {}
      }

      This code generates a spurious warning:


      TestCrash.java:241: warning: [rawtypes] found raw type: List
          @SuppressWarnings("rawtypes")
                            ^
        missing type arguments for generic class List<E>
        where E is a type-variable:
          E extends Object declared in interface List

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

              Created:
              Updated:
              Resolved: