Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.1
-
None
Description
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.