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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 8
    • 8, 8-repo-lambda
    • tools
    • b91
    • Verified

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: