Hi,
Today I was quite confused by behaviour of fields inside of closures.When I
read a field value it is visible, but when I try to set it, it is not set,
but a binding is set and then available for rest of the closure. This is
rather confusing, can I disable such behaviour in any way?
import groovy.transform.Field@Fieldint x = 0a {    assert x == 0    println
x    x = 1    assert x == 1    println x}assert x == 0println xdef a(Closure
c) {    c()}  ​




--
View this message in context: 
http://groovy.329449.n5.nabble.com/Closure-does-not-see-field-when-setting-value-tp5736534.html
Sent from the Groovy Users mailing list archive at Nabble.com.

Reply via email to