groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krzysztof Kowalczyk <kowalczyk.krzysz...@gmail.com>
Subject Re: Closure does not see field when setting value
Date Tue, 08 Nov 2016 21:21:52 GMT
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.
Mime
View raw message