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

Ternary Operator Spacing Issue

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Trivial
    • Resolution: Duplicate
    • 4.0.0
    • None
    • parser-antlr4
    • None

    Description

      When converting the Grails project to groovy 4, we noticed a compile error for the following code:

      def tags = null;
      tags = tags?[tags]:[] 

      Adding a space after the question mark succeeds in groovy 4.  Is this an expected compilation error or should no spaces be allowed?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jdaugherty James Daugherty
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: