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

Improve diagnostics when generic method and generic class use same name for type parameter

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Rejected
    • Icon: P5 P5
    • None
    • 5.0
    • tools
    • generic
    • generic

      Please, look at the following funny example:

      ExportBundler.java:1170: incompatible types
      found : java.util.Iterator<java.util.List<T>>
      required: java.util.Iterator<java.util.List<T>>
              for (Iterator<List<T>> lItr = lists.iterator(); lItr.hasNext();)

      Such error message is given if a generic method appears inside a generic
      class and both the method and the class use the same name for the type parameter.
      I believe that a new user will be really confused in this case

            Unassigned Unassigned
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: