Issue Details (XML | Word | Printable)

Key: GROOVY-2470
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Paul King
Reporter: Mike Dillon
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

Add support for coercing strings to enum classes with "as" keyword

Created: 06/Jan/08 01:13 AM   Updated: 08/Feb/08 01:26 AM
Component/s: groovy-jdk
Affects Version/s: None
Fix Version/s: 1.5.2

Time Tracking:
Not Specified

File Attachments: 1. File Enum-asType.diff (2 kB)


Testcase included: yes
Patch Submitted: Yes


 Description  « Hide
It would be cool if the "as" keyword could be used to coerce strings to enum values. Since this currently throws an exception, adding this functionality should have no impact on existing code.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King added a comment - 07/Jan/08 05:52 AM
Should be in r10236. Thanks for the patch.

Paul King added a comment - 08/Feb/08 01:26 AM
close off release 1.5.4