Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.1-beta-3
-
Fix Version/s: 1.1-rc-1
-
Component/s: None
-
Labels:None
-
Environment:jdk6u2
-
Number of attachments :
Description
I failed to compile my old project with groovy1.1beta3, but ok with groovy1.1beta2, so I tried to inspect why.
At last, I found the following code can not be executed properly in groovy1.1beta3, which is abstracted from my project.
Base.groovy
class Base {
int v
public Base(int v) {
this.v = v
}
}
Derived.groovy
class Derived extends Base { int[] vs public Derived(vs) { super(vs.size) this.vs = vs } public static void main(String[] args) { int[] vs = new int[5] println vs.length Base b = new Derived(vs); println b.vs } }
error msg:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Derived.groovy: 5: the name vs doesn't refer to a declared variab
le or class. The static scope requires to declare variables before using them. If the variable should have been a class check the spelling.
@ line 5, column 9.
super(vs.size)
^
1 error