Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: 3.0
-
Component/s: class generator
-
Labels:None
Description
this code:
class A {
private foo = 1
def getFoo(){
10.times { println this.foo }
return this.foo+1
}
}
def a = new A()
println a.foo
should not end in a stack overflow
Issue Links
- is depended upon by
-
GROOVY-2503
MOP 2.0 design inflluencing issues
-
the stack overflow happens, because the closures { println this.foo } or {println foo} will call the getFoo method again, instead of accessing the field directly, like we usually do from any method.