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

Newify fails for local variable assignment

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.9
    • Fix Version/s: 2.2.1
    • Component/s: None
    • Labels:
      None

      Description

      This:

          @Newify foo() {
              def x = Integer.new(42)
          }
          foo() 
      

      Fails with:

      Caught: groovy.lang.MissingMethodException: No signature of method: newifyBug.Integer() is applicable for argument types: (java.lang.Integer) values: [44]
      groovy.lang.MissingMethodException: No signature of method: newifyBug.Integer() is applicable for argument types: (java.lang.Integer) values: [44]
      at newifyBug.foo(newifyBug.groovy:6)
      at newifyBug.run(newifyBug.groovy:9)

      source: http://groovy.329449.n5.nabble.com/Potential-problem-with-Newify-td5717385.html

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              pschumacher Pascal Schumacher
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: