Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Consider the following:
class Main { static main(args) { this.meth() } static void meth(Runnable action = new Runnable() { @Override void run() { print 'works' } }) { action.run() } }
Compiling and executing this class results in org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'class Main' with class 'java.lang.Class' to class 'Main'.
See also GROOVY-6777, GROOVY-6809, GROOVY-7609 and GROOVY-9168