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

Flow typing doesn't work with assignment to a parameter

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.10
    • Fix Version/s: 2.4.12
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      import groovy.transform.CompileStatic
      
      class A {}
      class B extends A { def bbb() {} }
      
      @CompileStatic
      def fooLocalAssignment() {
          A a = new B()
          a.bbb()
      }
      
      @CompileStatic
      def fooParameterAssignment(A a) {
          a = new B() 
          a.bbb() // Cannot find matching method A#bbb()
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: