[
https://issues.apache.org/jira/browse/GROOVY-11600?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-11600.
----------------------------------
Fix Version/s: 5.0.0-alpha-13
Resolution: Fixed
> 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
> Fix For: 5.0.0-alpha-13
>
>
> {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)