Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Information Provided
-
4.0.12
-
None
-
None
Description
The Groovy compiler does not seem to make any attempt to verify that final fields are assigned during object construction, making possible very simple bugs (I added a property but forgot the "this" assignment) that the Java compiler flags. I'm aware that the richness of Groovy expressiveness may make this difficult, but it's frustrating not to have that safeguard.
class Bug { final Object o // and add an explicit constructor if you like }