Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3995

An inner enum class cannot resolve itself in its own body

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.7
    • 1.6.8
    • None
    • None

    Description

      The compilation of

      class Test {
      	enum Color {
      		  R, G, B
      		  public static Color[] ALL_COLORS = [R, G, B];
      	}
      }
      

      fails with

      unable to resolve class Color[] 
       @ line 4, column 5.
         		  public static Color[] ALL_COLORS = [R, G, B];
             ^
      
      1 error
      

      However the compilation of following code goes through (top-level enum):

      enum Color {
      	  R, G, B
      	  public static Color[] ALL_COLORS = [R, G, B];
      }
      

      Attachments

        Issue Links

          Activity

            People

              roshandawrani Roshan Dawrani
              roshandawrani Roshan Dawrani
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: