Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59911

Result of assignment expression is null rather than assigned value

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hello Guys,

      I found some weird behavior difference in executing the same groovy logic in pipeline from the original groovy 2.4.12 (used in the latest LTS Jenkins by default).

      The next logic is working in different ways for pipeline and script console:

      def b = 3
      def a = b = 4
      print("${a} ${b}")
      
      • Groovy console print output: "4 4"
      • Pipeline echo output: "null 4"

      Who can tell why? I just can't catch the difference.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            sparshev Sergei Parshev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: