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

@Immutable should provide a no-arg constructor

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.6, 2.0.5
    • Fix Version/s: 2.2.2
    • Component/s: xforms
    • Labels:
      None
    • Environment:
      Ubuntu Precise
      Groovy Version: 1.8.6 JVM: 1.6.0_27 Vendor: Sun Microsystems Inc. OS: Linux
      Groovy Version: 2.0.5 JVM: 1.7.0_25 Vendor: Oracle Corporation OS: Linux

      Description

      Given this class:

      @Immutable class Y { Collection c = []; int foo = 1 }
      

      I expect the following to succeed:

      def y = new Y()
      assert y.c.class.name.constains('Unmodifiable')
      

      In general, calling the no-arg constructor won't provide an interesting result unless the properties have default values but the constructor call should pass nonetheless.

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              wu-lee Nick Stokoe
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: