You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2023/04/15 18:30:00 UTC

[jira] [Closed] (GROOVY-10305) Groovy records do not allow creating non-compact constructors with signature matching the record one

     [ https://issues.apache.org/jira/browse/GROOVY-10305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Sun closed GROOVY-10305.
-------------------------------
    Fix Version/s: 4.0.11
         Assignee: Daniel Sun
       Resolution: Fixed

> Groovy records do not allow creating non-compact constructors with signature matching the record one
> ----------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-10305
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10305
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 4.0.0-beta-1
>            Reporter: Konstantin Nisht
>            Assignee: Daniel Sun
>            Priority: Critical
>              Labels: ClassFormatError
>             Fix For: 4.0.11
>
>
> The following code
> {code:java}
> record X(int a) {
>     public X(int a) {
>         println "abcd"
>     }
> }
> def x = new X(10){code}
>  
> fails to run with an exception "java.lang.ClassFormatError: Duplicate method name "<init>" with signature "(I)V" in class file X". Similar code in java works fine.



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