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

Collected TupleConstructor causes internal compiler error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.5
    • 4.0.7
    • Compiler
    • None

    Description

      I have an in-house annotation collector that applies some of the usual transforms (TupleConstructor, ToString, CompileStatic/POJO). There's a particular class where I want a no-arg constructor available, and I expected that I could "override" the annotation's values like this:

      class TcBug {
          @AnnotationCollector
          @TupleConstructor(defaults = false)
          @interface Collector {}
      
          @Collector
          @TupleConstructor(defaults = true)
          static class Foo {
              Integer value
          }
      }
      

      However, this results in the following error message. I had thought that the above would work; if it isn't "supposed to", then a clearer error message (with location) would be helpful.

      TcBug.groovy: -1: Unable to compile class com.example.TcBug$Foo due to hash collision in constructors @ line -1, column -1.
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              chrylis Christopher Smith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: