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

Allow single statement without {} with if, for, while

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-1
    • 1.0-beta-2
    • None
    • None

    Description

      Currently, it is not possible to write :
      if (true) println("true")

      We have to write instead :
      if (true)

      { println("true") }

      So, it could be nice if the curly braces were not mandatory for single statements.

      Attachments

        Activity

          People

            jstrachan James Strachan
            guillaume Guillaume Sauthier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: