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

SC internal error when spreading inside list literal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.12
    • 5.0.0-alpha-1
    • Static compilation
    • None

    Description

      Spreading a list inside brackets causes a SpreadExpression should not be visited here during class generation. (The business instance of this is trying to use a list of URL patterns for Spring antMatchers.)

      @CompileStatic
      class Bug {
          public static final List<String> A = ['a1', 'a2']
      
          static void varargs(String... strings) {
              println Arrays.toString(strings)
          }
      
          public static void main(String... args) {
              varargs([
                  *A
              ] as String[])
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              chrylis Christopher Smith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: