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

Improve error message in the case the user defines a "run" method in a script

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.2
    • Component/s: None
    • Labels:
      None

      Description

      If someone writes a script with a `run` method:

      def run() { println 'ok' }
      run()
      

      Then there's a misleading error message:

      The method public java.lang.Object run()  { ... } duplicates another method of the same signature
      . At [1:1]  at line: 1, column: 1
      

      It would be better to report that it is not possible to have a `run` method in a script instead.

        Attachments

          Activity

            People

            • Assignee:
              melix Cédric Champeau
              Reporter:
              melix Cédric Champeau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: