Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.0
-
None
Description
The following works with 1.7.x but fails with 1.8.0
Demo.groovy
class Demo { void doit() { execute new Runnable(){ void run() { println 'hello' } } } void execute(arg) { arg.run() } static void main(args) { new Demo().doit() } }
The code fails with a MissingPropertyException:
$ groovy Demo Caught: groovy.lang.MissingPropertyException: No such property: execute for class: Demo at Demo.doit(Demo.groovy:4) at Demo.main(Demo.groovy:16)
If I put parens around the argument to the execute method, then it appears to work:
Demo.groovy
class Demo { void doit() { execute(new Runnable(){ void run() { println 'hello' } }) } void execute(arg) { arg.run() } static void main(args) { new Demo().doit() } }