Issue Details (XML | Word | Printable)

Key: GROOVY-1879
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: Bob Alexander
Votes: 0
Watchers: 0
Operations

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

Error parsing simple expression in a conditional.

Created: 08/May/07 10:35 AM   Updated: 08/May/07 11:33 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1-beta-2

Time Tracking:
Not Specified


 Description  « Hide
Cannot parse:

if (a = false) println "xx"

but can parse:

if ((a = false)) println "xx"

Of course this is a useless statement, but it also fails with any boolean-values expression substituted for "false".



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jochen Theodorou added a comment - 08/May/07 11:33 AM
this is no bug, this is by design. As we allow every object to be evaluated to a boolean we decided to not to allow the assignment if it is not in (). It's just a very simple case to avoid the fear known from C.