Issue Details (XML | Word | Printable)

Key: GROOVY-1283
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jochen Theodorou
Reporter: John Wilson
Votes: 0
Watchers: 0
Operations

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

Names in inner closure are not resolved against the right owner

Created: 27/Mar/06 10:23 AM   Updated: 28/Mar/06 02:16 PM   Resolved: 28/Mar/06 02:16 PM
Component/s: class generator
Affects Version/s: 1.0-JSR-5
Fix Version/s: 1.0-JSR-6

Time Tracking:
Not Specified


 Description  « Hide

import groovy.xml.StreamingMarkupBuilder

def doc = new StreamingMarkupBuilder().bind {
root {
1..2.each { item() }
}
}

System.out << doc

fails as item is not resolved.

This is because the owner of the each closure has been set to the script. The owner should be the colsure passed to the root method.



Jochen Theodorou added a comment - 28/Mar/06 02:16 PM

fixed now