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

TupleConstructor overwrites empty default constructors

    XMLWordPrintableJSON

Details

    Description

      @TupleConstructor should not overwrite existing empty default constructors. For example, this should work, but doesn't currently

      assert new Cat("Mr. Bigglesworth").name == null  // fails
      
      @groovy.transform.TupleConstructor
      class Cat {
        String name
        int age
        Cat(String name) {}
      }
      

      Granted, this is an edge case. But unexpected behavior, nonetheless.

      Attachments

        Activity

          People

            paulk Paul King
            keegan Keegan Witt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: