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

@Newify AST transformation doesn't work for anon inner classes

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0-rc-3
    • 2.3.7, 2.4.0-beta-3
    • xforms
    • None

    Description

      This code:

      @Newify String test() {
        new Object() { def x() { String.new('ABC') } }.x()
      }
      assert "ABC"==test()
      

      results in:

      groovy.lang.MissingMethodException: No signature of method: static java.lang.String.new() is applicable for argument types: (java.lang.String) values: [ABC]
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            paulk Paul King
            uehaj UEHARA Junji
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment