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

improve diagnostic for "instanceof T" for type parameter T

    Details

    • Subcomponent:
    • Resolved In Build:
      b110
    • CPU:
      generic
    • OS:
      solaris_8
    • Verification:
      Verified

      Description

      If T is an identifier for a parameterized type, then using
      "instanceof T" obviously shouldn't be legal. The compiler does enforce
      this but the error message "unexpected type ... found T, required class
      or array" doesn't make it obvious that this is a deliberate restriction.

      --------------------------------

      An example:

      class T4881267 {
          <T> void m(Object o) {
      boolean b = o instanceof T;
          }
      }

      ###@###.### 2004-09-17

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kizune Alexander Zuev
                Reporter:
                gafter Neal Gafter
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: