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

String Array Concatenation result modified by Static Compilation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.2
    • 2.2.3
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: