Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-5
-
None
-
Windows XP, JDK1.5,
Description
NOTE: THE TEST CASE PASSE: however running the following code from GroovyConsole fails.
class A {
def a = 0
def b = 0
A(a)
{ this(a, 10) }A(a, b)
{ this.a = a this.b = b }}
def a = new A(5)
println a.a
println a.b
Output:
0
0
The call to this(a, 10) allocates a new object, initializes it with the second contructor, and then throws it away. I verified this using JSwat and printlns.
Again: The test case passes for some reason.