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

latest diamond implementation generates spurious raw type warnings

XMLWordPrintable

    • b97
    • unknown
    • generic
    • Verified

      The new diamond implementation generates spurious raw types diagnostics:

      class Foo<X> {
         Foo() {}
         Foo<String> f = new Foo<>();
      }

      this produces the following output (when compiled with -Xlint):

      TestX.java:3: warning: [rawtypes] found raw type: Foo
         Foo<String> f = new Foo<>();
                                ^
        missing type parameters for generic class Foo<X>
        where X is a type-variable:
          X extends Object declared in class Foo
      1 warning

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: