Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
-
None
Description
The sample below outputs "value" as is. When cl.resolveStrategy = Closure.DELEGATE_FIRST is added before cl(), it outputs "null" when I would expect "value" since that's available from owner. When cl.resolveStrategy = Closure.DELEGATE_ONLY is added instead, it outputs "null" when I would expect a missing property exception.
class Test { def prop = 'value' def meth() { def cl = { -> println prop } cl.delegate = [:] cl() } } new Test().meth()
This was run using Groovy Web Console.