Ok, thanks.

So that would make this.x reference works as expected but still x = 1 would
work in surprising way. Why to allow creation of new bindings in this way
at all? Reading bindings, fine, but creating new? To share them with
outside world?

The behaviour is surprising to me in 2 ways:
First, I do create a new thing even though it "exists".
Second, if I compile it in static way it will behave differently.

@CompileStatic should behave as I want (I guess), but I can't easily apply
@CompileStatic to a script, can I?

Regards,
Krzysztof




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

Reply via email to