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

omitting parens in constructor call

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • parser
    • None
    • all

    Description

      When parentheses are omitted from a constructor call, the parser gives an UnexpectedTokenException. Additionally, if the comma is omitted it gives an IndexOutOfBoundsException.
      Here's an example.

      class Car {
      String make
      String model

      Car() {}

      Car(String make, String model)

      { this.make = make this.model = model }

      }

      c = new Car 'Honda','Odyssey'
      println c.dump()

      Attachments

        Issue Links

          Activity

            People

              guillaume Guillaume Sauthier
              mvolkmann R. Mark Volkmann
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: