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

CCE in closure shared variable assignment

    XMLWordPrintableJSON

    Details

      Description

      class A {}
      class B {}
      
      @groovy.transform.CompileStatic
      def cs() {
          def var
          var = new A()
          def c = {
              var = new B() // Cannot cast object 'B@4e234c52' with class 'B' to class 'A'
          }
          c()
          var.toString()
      }
      
      assert cs() != null
      

        Attachments

          Activity

            People

            • Assignee:
              emilles Eric Milles
              Reporter:
              daniilo Daniil Ovchinnikov
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h