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

Results of spread safe method calls should be stored in temporary variables

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.5
    • 2.4.6
    • Static compilation
    • None

    Description

      Currently, the following code throws an NPE during class generation because the static compiler creates variables of the form "spreadresultX" to store the results of spread safe method calls. See GROOVY-7656 for the original discussion.

      @groovy.transform.CompileStatic
      static void test(String a, String b, List spreadresult1) {
          [a, b]*.length()
      }
      test('a', 'b', [])
      

      Attachments

        Activity

          People

            shils Shil Sinha
            shils Shil Sinha
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: