Daniil Ovchinnikov created GROOVY-9344:
------------------------------------------

             Summary: CCE in closure shared variable assignment
                 Key: GROOVY-9344
                 URL: https://issues.apache.org/jira/browse/GROOVY-9344
             Project: Groovy
          Issue Type: Bug
          Components: Static compilation, Static Type Checker
    Affects Versions: 2.5.8
            Reporter: Daniil Ovchinnikov


{code}
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
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to