You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like the anon. inner class does not have access to the enclosing closure's delegate/owner/thisObject resolution.
classFoo {
String string ='foo'
}
newFoo().with {
def bar =newObject() {
StringtoString() { string }
}
println bar
}
groovy.lang.MissingPropertyException: No such property: string for class: Script1
at Script1$1.toString(Script1.groovy:8)
at Script1$_run_closure1.doCall(Script1.groovy:10)
at Script1.run(Script1.groovy:5)
However, I can still access "it" (or any closure parameters if they had been declared).
Consider the following:
The variable expressions "chars" within the "characters" method are showing as unknown (underlined).
The text was updated successfully, but these errors were encountered: