You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/07/23 14:17:06 UTC

[jira] [Closed] (GROOVY-9344) CCE in closure shared variable assignment

     [ https://issues.apache.org/jira/browse/GROOVY-9344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-9344.
-----------------------------

> 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
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-alpha-1, 3.0.5
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> {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)