Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1176

Runtime does does not choose from multimethods corect;y

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-4
    • 1.0-RC-1
    • None

    Description

      import java.text.DecimalFormat

      df = new DecimalFormat()

      println df.format(1)

      throws
      Caught: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.text.DecimalFormat#format.
      Cannot resolve which method to invoke for

      {class java.lang.Integer}

      due to overlapping prototypes between:

      {double} {long}

      Very good error message
      But it should choose the metyhod which takes long.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            tug John Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: