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

closure syntax not recognized

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0-beta-5
    • 1.0-JSR-4
    • parser
    • None

    Description

      I just realized that there was a backdoor to overload () operator:

      doCall() method:

      class A {
      doCall(c)

      { c() }

      }

      a = new A()
      a

      {println 'hello'}

      // works

      // I thought I could do

      new A()

      {println 'hello again'}

      // but this does not parse
      // then I realized that it looked so much like an anonymous class
      // maybe that had confused the parser.

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            bingran Bing Ran
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: