groovy

Running invalid Groovy program produces IncompatibleClassChangeError

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7-beta-1
  • Fix Version/s: 1.6.6, 1.7-rc-1
  • Component/s: Compiler
  • Labels:
    None
  • Number of attachments :
    0

Description

Although the following program is invalid, it probably shouldn't produce an IncompatibleClassChangeError at runtime:

class Foo {
  static main(args) {
    super.bar()
  }
}

Activity

Hide
Roshan Dawrani added a comment -

After we get rid of the runtime error IncompatibleClassChangeError , what should be the behavior of this program - should it be a compilation error as it is in Java? I guess not, because this.bar() is allowed in static context. Should it become a static call on the super class?

Show
Roshan Dawrani added a comment - After we get rid of the runtime error IncompatibleClassChangeError , what should be the behavior of this program - should it be a compilation error as it is in Java? I guess not, because this.bar() is allowed in static context. Should it become a static call on the super class?
Hide
Roshan Dawrani added a comment -

Fixed. Got the answer to my question in the current behavior of super.bar property access, which failed with compilation error "'super' cannot be used in a static context, use the explicit class instead."

Show
Roshan Dawrani added a comment - Fixed. Got the answer to my question in the current behavior of super.bar property access, which failed with compilation error "'super' cannot be used in a static context, use the explicit class instead."

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: