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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.4.6
    • Component/s: Static compilation
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: