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

Spurious raw types warning when using unbound method references

    XMLWordPrintable

Details

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

    Description

      The following code gives an undeserved warning:

      interface Foo<X> {
          void m(List<X> lx, X x);
      }

      class Test {
          Foo<String> fs1 = List::add; //warning: List is a raw type
      }

      The warning is undeserved, as List type-parameters are being inferred from the context.

      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: