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

Operators other than dot do not support carriage returns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.3.0-beta-1
    • syntax
    • None

    Description

      In Groovy, you can add carriage returns before the dot operator. For instance:

      doSomething()
          .somethingElse()
          .collect { ... }
      

      But with the safe navigation operator or the spread operator, it does not work.

      doSomething()
          ?.somethingElse() // does not compile, "unexpected token ?."
          ?.collect { ... }
      
      doSomething()
          *.somethingElse() // does not compile, "unexpected token *."
          .collect { ... }
      

      Attachments

        Activity

          People

            paulk Paul King
            antoine_ Antoine
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: