Details
-
Type:
Wish
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-JSR-5, 1.0-JSR-6
-
Fix Version/s: 1.1-beta-1
-
Component/s: groovy-jdk
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
use(StringCategory) {
return "hello".capitalize()
}
returns null (use is a void method). However a closure call always returns Object. In keeping with the element of least surprise, use() should return the closures return value.
Issue Links
- is duplicated by
-
GROOVY-1770
use(category){closure} should propagate the value returned by its closure
-
- relates to
-
GROOVY-2474
Change all withXXX methods to return the value returned by their closure instead of void
-
I have attached a patch including a simple test case.