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

Conditional expression containing an assignment operation requires double parentheses

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Won't Fix
    • 1.1-beta-2
    • 1.1-beta-3
    • None
    • None

    Description

      In groovy,

      a = b = c // valid
      a = (b = c ) // valid

      However:

      if (( b = c )) statement // valid but only with double parentheses

      if (b=c) statement // compiler error: " expecting ')', found '=' " Note that this syntax is valid in java provided b and c are boolean

      It seems this syntax should be valid without the need for double parentheses.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            jkranes jkranes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: