groovy

Names in inner closure are not resolved against the right owner

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-JSR-5
  • Fix Version/s: 1.0-JSR-6
  • Component/s: class generator
  • Labels:
    None
  • Number of attachments :
    0

Description

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.

Activity

Hide
blackdrag blackdrag added a comment -

fixed now

Show
blackdrag blackdrag added a comment - fixed now

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: