When calling an object's definition and accessing a local variable, the variable can't be resolved. That is, because, inside InContext expression, the Context being passed by is the object's instance context, instead of the caller context.
Then, the arguments resolvement is being done within object's context instead of caller's context.
For example:
object Test {
def test(int i) {
println(i)
}
}
test = new Test()
j = 2
test.test(j)
This example will fail, because there is no variable 'j' inside object's context, only in script's context.
When calling an object's definition and accessing a local variable, the variable can't be resolved. That is, because, inside InContext expression, the Context being passed by is the object's instance context, instead of the caller context.
Then, the arguments resolvement is being done within object's context instead of caller's context.
For example:
This example will fail, because there is no variable 'j' inside object's context, only in script's context.