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

Closure constant on interface not callable without call()

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

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.1-beta-1
    • None
    • None

    Description

      If I add a closure constant in an interface, I can't call it with V.c("hello").
      Instead, I have to do V.c.call("hello")

      groovy> interface V { Closure c =

      { println it }

      }
      groovy> V.c("hello")
      groovy> go
      Caught: java.lang.NullPointerException
      at CommandLine.run(CommandLine.groovy:2)

      Attachments

        Activity

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

          People

            blackdrag Jochen Theodorou
            guillaume Guillaume Sauthier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment