Konstantin Nisht created GROOVY-10305:
-----------------------------------------

             Summary: 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


The following code
{{
record X(int a) {
    public X(int a) {
        println "abcd"
    }
}

new X(1)
}}

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.3.4#803005)

Reply via email to