Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Mac OS X 10.3.3, java 1.4.2
Description
I posted this on the mailing lists, but got no reply, so I will create a bug report:
I am having problems with a child class accessing a super
class's fields. Here is the simplest code that demonstrate this
problem:
A.groovy:
class A {
public aa
A()
{ aa = "this is not set!" }doit()
{ println aa }}
B.groovy:
class B extends A {
B()
static void main(args)
{ bb = new B() }}
Now when I run:
$ groovy B.groovy
I get:
this is not set.
So it seems that B set his own copy of aa instead of the super
class's aa. If I changed the line:
aa = "now B has set it!"
to:
this.aa = "now B has set it!"
it works.
Attachments
Issue Links
- is depended upon by
-
GROOVY-754 scoping
- Closed