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

Operators other than dot do not support carriage returns

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0-beta-1
    • Component/s: syntax
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: