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

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

    [ https://issues.apache.org/jira/browse/GROOVY-10789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17620517#comment-17620517 ] 

Eric Milles edited comment on GROOVY-10789 at 10/19/22 7:19 PM:
----------------------------------------------------------------

The hash error comes from way down where it checks the list of constructors and finds a duplicate.  That is, something generated an extra constructor.  I think you are getting dual application of TupleConstructor.


was (Author: emilles):
The hash error comes from way down where it checks the list of constructors and finds a duplicate.  That is, something generated an extra constructor.

> 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
>            Priority: Major
>
> 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)