Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.0.2
-
Component/s: Static compilation
-
Labels:None
-
Number of attachments :
Description
This code
@CompileStatic
class X {
static void bar(){
for (int i=0;i<1000000; i+=foo()){}
}
static foo(){1}
}
may not make so much sense, but should at least not fail during compilation with a GroovyBugError. The message complains about the method call in the i+=foo() part
The problem doesn't seem to be related to the loop increment, but with the fact of calling a static method as an argument of plus:
static foo() { 1 } 1+foo()produces: