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

Semantics of multiple assignment different using @CompileStatic

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.5
    • Fix Version/s: 2.1.6
    • Component/s: Static compilation
    • Labels:
      None

      Description

      The static compiler doesn't have the same semantics for multiple assignments. For example, this:

      void test(int result, int next) {
          (result, next) =  [next, next + result]
          println result
          println next
      }
      
      test(0,1)
      

      prints

      1
      1
      

      but using @CompileStatic, it returns:

      1
      2
      

      Behaviors should be aligned.

        Attachments

          Activity

            People

            • Assignee:
              melix Cédric Champeau
              Reporter:
              melix Cédric Champeau
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: