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

Method-scoped enums no longer allowed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 5.0u12
    • tools
    • x86
    • windows_xp

      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?

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: