Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.0
-
None
-
n/a
Description
The obvious example:
String.'package'.name
... the parser really should be able to clearly determine that a property is a property - and not a keyword.
Not only does this merely look bad, but it's a source of frustration and error, not to mention difficult to understand/debug for new users to groovy:
groovy -e "println String.package.name"
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, script_from_command_line: 1: unexpected token: . @ line 1, column 15.
... even if the error was more along the lines of "invalid use of reserved keyword: property", it would still be a source of frustration, not to mention it kind of looks bad from a technical standpoint.
As per the following thread on groovy users mailing list:
http://archive.groovy.codehaus.org/user/200701132220.08256.corey_s%40qwest.net