[ https://issues.apache.org/jira/browse/GROOVY-11600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17941183#comment-17941183 ]
ASF GitHub Bot commented on GROOVY-11600: ----------------------------------------- eric-milles opened a new pull request, #2176: URL: https://github.com/apache/groovy/pull/2176 also static modifier for inner `enum`, `trait`, `interface` or `annotation` > Static compiler should treat inner records as static > ---------------------------------------------------- > > Key: GROOVY-11600 > URL: https://issues.apache.org/jira/browse/GROOVY-11600 > Project: Groovy > Issue Type: Bug > Components: Static compilation, Static Type Checker > Affects Versions: 4.0.25, 4.0.26 > Reporter: Leonard Brünings > Assignee: Eric Milles > Priority: Major > > {code:title=should work|language=groovy} > @groovy.transform.CompileStatic > class Reproducer { > def foo() { > new MyRecord(42) > } > record MyRecord(int i) {} > } > {code} > But fails with {{[Static type checking] - Cannot find matching constructor > Reproducer$MyRecord(Reproducer, int)}} > These work > {code:title=static record|language=groovy} > @groovy.transform.CompileStatic > class Reproducer { > def foo() { > new MyRecord(42) > } > static record MyRecord(int i) {} > } > {code} > {code:title=static method|language=groovy} > @groovy.transform.CompileStatic > class Reproducer { > static def foo() { > new MyRecord(42) > } > record MyRecord(int i) {} > } > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)