Issue Details (XML | Word | Printable)

Key: GROOVY-1770
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Paul King
Reporter: Ben Smith
Votes: 0
Watchers: 0
Operations

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

use(category){closure} should propagate the value returned by its closure

Created: 06/Mar/07 01:26 PM   Updated: 06/Jan/08 04:55 PM   Resolved: 06/Mar/07 08:28 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1-beta-1

Time Tracking:
Not Specified

File Attachments: 1. File TestPropogatingUse.groovy (0.9 kB)

Issue Links:
Duplicate
 
Related
 

Testcase included: yes


 Description  « Hide

The use(category){closure} construct doesn't seem to be returning any useful value. It would be useful if it propagated the value returned by its closure. This would a more natural "use" of categories in cases like:

def function() {
return use(HelperFunctions) { if (checkSomething) return EARLY //... return LATE }
}



Paul King added a comment - 06/Mar/07 08:28 PM

Should work in HEAD.