Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-6
-
None
-
None
Description
I'm having problems with multiple nested closures. The code looks like something like this:
#! /bin/groovysh
def values = [:]
def format = ["a":true, "b":false]
def input = ["a", "ok", "b"]format.each () {
def id = it.key
if ( it.value )
input.each () { values.put(id, it) }
else
input.each () { values.put(id, it) }
}
When the sript run all I get is a VerifyError exception:
Caught: java.lang.VerifyError: (class: issue_example$_run_closure1, method: doCall signature: (Ljava/lang/Object;)Ljava/lang/Object Accessing value from uninitialized register 5
at issue_example.run(issue_example.groovy:6)
at issue_example.main(issue_example.groovy)
Surprisinly, if I change the else instruction to any non closure sentence, the script runs as expected.