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

String Array Concatenation result modified by Static Compilation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.2.3
    • Component/s: None
    • Labels:
      None

      Description

      To reproduce

      import groovy.transform.CompileStatic
      
      @CompileStatic
      public class Concat {
        public static void main(String[] args) {
          def x = 'a,b,c'.split(',')
          def y = 'd,e,f'.split(',')
          println(x + y)
        }
      } 
      

      Without @CompileStatic yields:

      [a, b, c, d, e, f]
      

      With @CompileStatic yields:

      [a, b, c, [d, e, f]]
      

      Should rather be the same.

        Attachments

          Activity

            People

            • Assignee:
              melix Cédric Champeau
              Reporter:
              tkruse Thibault Kruse
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: