Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.0-JSR-3
-
None
-
Debian
Description
The two attached classes cannot be compiled since the CircularInvoke2 class refers to a static method on the CircularInvoke class; it is a circular dependency thing. The same code example works fine in java.
This is the result of the compile is as follows:
[...] /groovy/bugs$ groovyc -d /tmp CircularInvoke*
CircularInvoke2.groovy: 5: The variable CircularInvoke is undefined in the current scope
@ line 5, column 5.
CircularInvoke.m()
^
1 Error
The workaround is to comment the above line that gives the failure, recompile, and then uncomment the line again. Now the classloader is able to find the CircularInvoke.m() method (from the target location /tmp) and is then able to compile also the CircularInvoke2 class. However, this process is quite manual and very displeasing.