Issue Details (XML | Word | Printable)

Key: GROOVY-1344
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Jochen Theodorou
Reporter: Edward Povazan
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

IncompatibleClassChangeError is thrown when an arg is assigned a default value from a static constant of another class.

Created: 14/Jun/06 02:08 AM   Updated: 15/Jun/06 12:33 PM   Resolved: 15/Jun/06 12:33 PM
Component/s: class generator
Affects Version/s: 1.0-JSR-6
Fix Version/s: 1.0-JSR-6

Time Tracking:
Not Specified

File Attachments: 1. File NoThrowIncompatibleClassChangeErrorTest.groovy (0.8 kB)

Environment: Groovy Version: 1.0-RC-01-SNAPSHOT JVM: 1.5.0_06-b05

Testcase included: yes


 Description  « Hide

class Something {
static int VALUE = 10
}

class AnotherThing {
def method(somearg=Something.VALUE) { }
}

The above throws an IncompatibleClassChangeError.



Edward Povazan added a comment - 14/Jun/06 02:14 AM

Nuts, made a mistake in my description (is there a way to edit that I don't see?)
class Something {
static int VALUE = 10
}

class AnotherThing {
static method(int somearg=Something.VALUE) { }
}

AnotherThing.method()

This demonstrates the exception. As does the attached test case.


Jochen Theodorou added a comment - 15/Jun/06 12:33 PM

looks like neither the scoping, nor the class resolving was done for default arguments, this is corrected now and the resulting code does now no longer produce the error. Fixed.