You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Christopher Smith (Jira)" <ji...@apache.org> on 2022/10/10 17:23:00 UTC

[jira] [Created] (GROOVY-10789) Collected TupleConstructor causes internal compiler error

Christopher Smith created GROOVY-10789:
------------------------------------------

             Summary: Collected TupleConstructor causes internal compiler error
                 Key: GROOVY-10789
                 URL: https://issues.apache.org/jira/browse/GROOVY-10789
             Project: Groovy
          Issue Type: Bug
          Components: Compiler
    Affects Versions: 4.0.5
            Reporter: Christopher Smith


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:

{code:groovy}
class TcBug {
    @AnnotationCollector
    @TupleConstructor(defaults = false)
    @interface Collector {}

    @Collector
    @TupleConstructor(defaults = true)
    static class Foo {
        Integer value
    }
}
{code}

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.

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




--
This message was sent by Atlassian Jira
(v8.20.10#820010)