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

Misleading error message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-9
    • 1.0-beta-10
    • None
    • None
    • Windows XP, JVM 1.4.2_06

    Description

      In the following code I forgot to put "Math." in front of pow:

      import java.lang.Math

      def foo(Double x)
      {
      return pow(x, 1.5d)
      }

      //foo(3.5d)

      c =

      {foo(it)}

      c(3.5d)

      If I run this, it says foo() doesn't take a single Double:

      Caught: groovy.lang.MissingMethodException: No signature of method bug3$_run_closure1.foo() is applicable for argument types: (java.lang.Double) values: [3.5]

      If I call foo directly, I get an exception in the call to pow(), as it should be.

      Messages like this make development time really baloon, and are a barrier to me using Groovy for more than I do now.

      Attachments

        1. Closure.diff.txt
          1.0 kB
          Kim, Pilho

        Activity

          People

            Unassigned Unassigned
            mcspanky Martin C. Martin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: