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

Method-scoped enums no longer allowed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 5.0u12
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      a compiler error "enum types must be local", check a similar discussion going on at
      http://forum.java.sun.com/thread.jspa?forumID=54&threadID=595962

      It seems that prior to Java 1.5.0_01 method-scoped enums were allowed:

      static void main(String[] args)
      {
        enum Colors { RED, GREEN, BLUE };
      }

      but once in 1.5.0_01 you get the aforementioned compiler error. sounds like
      a regression in bug #5081785?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              tyao Ting-Yun Ingrid Yao (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: