[
https://issues.apache.org/jira/browse/GROOVY-10548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-10548.
------------------------------
> Static compiler allows property access on records but uses wrong method names
> -----------------------------------------------------------------------------
>
> Key: GROOVY-10548
> URL: https://issues.apache.org/jira/browse/GROOVY-10548
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 4.0.1
> Reporter: Christopher Smith
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.0-alpha-1, 4.0.2
>
>
> When using the new {{record}} feature, Groovy creates methods that _exactly_
> match the property name (without the traditional get/is prefix):
> {{person.email()}}. In static code, the compiler permits traditional
> property-style access: {{person.email}}. However, in this case it generates a
> method call to {{Person.getEmail()}}, and this causes a {{NoSuchMethodError}}
> at runtime.
> Either the static compiler should error out because there's no visible
> JavaBean property, or it should generate code calling the record-style
> accessor.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)