groovy

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

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.0-JSR-6
  • Fix Version/s: 1.0-JSR-6
  • Component/s: class generator
  • Labels:
    None
  • Environment:
    Groovy Version: 1.0-RC-01-SNAPSHOT JVM: 1.5.0_06-b05
  • Testcase included:
    yes
  • Number of attachments :
    1

Description

class Something {
static int VALUE = 10
}

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

The above throws an IncompatibleClassChangeError.

Activity

Hide
Edward Povazan added a comment -

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.

Show
Edward Povazan added a comment - 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.
Hide
blackdrag blackdrag added a comment -

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.

Show
blackdrag blackdrag added a comment - 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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: