groovy

Class constructor problem

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.0-beta-9
  • Fix Version/s: 1.0-JSR-6
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP
  • Number of attachments :
    1

Description

The default constructor in class Point gives rise to the
following error:

Caught: groovy.lang.MissingMethodException: No signature of method
Point.doCall() is applicable for argument types: (java.lang.Integer, java.lang.Integer)
values: [0, 0]

class Point {

Point(x, y) { this.x = x this.y = y }

Point() { this(0, 0) // PROBLEM HERE }

// ---------- properties ----------------------------------

x
y
}

pp = new Point(1, 2)
qq = new Point()

println "pp: ${pp.x} ${pp.y}"
println "qq: ${qq.x} ${qq.y}"

Activity

Hide
blackdrag blackdrag added a comment -

fixed

Show
blackdrag blackdrag added a comment - fixed

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: