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

Newify fails for local variable assignment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.9
    • 2.2.1
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: