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

static init block in enum fails in 1-7-beta1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7-beta-1
    • 1.6.5, 1.7-beta-2
    • Compiler
    • None
    • Groovy Version: 1.7-beta-1 JVM: 1.6.0_11
      windows xp sp3

    Description

      static init block in enum fails, similar code in a class works:

      package p
      enum Color {
      r,g,b
      static List l=[1,2]
      static init()

      { println "in init(), l=$l" }

      static

      { init() }

      }
      //Color.init();
      println Color.r

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: