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

Object initializer not being called on object construction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.8-rc-2
    • 1.8-rc-4
    • None
    • None

    Description

      Perhaps related to GROOVY-4733.

      I would expect that this code prints "99", but it doesn't. It prints "9":

      class A {
              {
                      print f
      		}
              def f = 9 //
      		def other = { }
      		{
              	print f }
      }
      new A()
      

      This code, however, prints "99":

      class A {
              {
                      print f
      		}
      		{
              	print f }
              def f = 9 //
      		def other = { }
      }
      new A()
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            werdna Andrew Eisenberg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: