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

A return statement that contains an assignment returns null instead of the value assigned

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.5.2
    • 1.5.3
    • None
    • None
    • Windows

    Description

      I have used the following construct:

      return values[m[0][1]] = m[0][3] as BigDecimal

      Up until 1.5.1 this returns the value. With 1.5.2-Snapshot it returns null.

      The following

      values[m[0][1]] = m[0][3] as BigDecimal
      return values[m[0][1]]

      works as expected.

      The test case is part of the book examples, so don't ask for practical use

      Attachments

        1. MethodAdditionCalc.groovy
          0.8 kB
          Joachim Baumann

        Activity

          People

            Unassigned Unassigned
            jbaumann Joachim Baumann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: