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

SC: IncompatibleClassChangeError when closure direct-targets extension method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0.18, 4.0.12
    • Static compilation
    • None

    Description

      Consider the following:

      @groovy.transform.CompileStatic
      void test() {
          def c = { p, q = p.toString() -> '' + p + q }
          assert c('foo', 'bar') == 'foobar'
          assert c('foo') == 'foofoo'
      }
      test()
      

      Default argument creates delegate method that does not have static compilation. Running script throws java.lang.IncompatibleClassChangeError.

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: