
|
If you were logged in you would be able to see more operations.
|
|
|
groovy
Created: 22/Feb/07 01:17 AM
Updated: 08/Feb/08 01:26 AM
|
|
| Component/s: |
None
|
| Affects Version/s: |
1.0
|
| Fix Version/s: |
1.5.2
|
|
Running
{ println "foo" }
in the groovyConsole results in the compiler error message "Closure expression looks like it may be an isolated open block.;
solution: Add an explicit parameter list, as in {it -> ...}, or label it as L:{...}.". For me as a groovy newbie it wasn't clear that the first solution marks the code as closure while the second marks it as block, I thought that both would result in a closure. Perhaps the wording should be changed to something like this:
"Expression could be either a closure expression or an isolated open block. Solution: Add an explicit parameter list, as in {it -> ...}, to create a closure or label it as L:{...} to mark it as block."
|
|
Description
|
Running
{ println "foo" }
in the groovyConsole results in the compiler error message "Closure expression looks like it may be an isolated open block.;
solution: Add an explicit parameter list, as in {it -> ...}, or label it as L:{...}.". For me as a groovy newbie it wasn't clear that the first solution marks the code as closure while the second marks it as block, I thought that both would result in a closure. Perhaps the wording should be changed to something like this:
"Expression could be either a closure expression or an isolated open block. Solution: Add an explicit parameter list, as in {it -> ...}, to create a closure or label it as L:{...} to mark it as block." |
Show » |
|