[jira] [Resolved] (GROOVY-8355) Instanceof inference does not work on field assigning

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (GROOVY-8355) Instanceof inference does not work on field assigning

JIRA jira@apache.org

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

Daniel Sun resolved GROOVY-8355.
--------------------------------
       Resolution: Fixed
         Assignee: Daniel Sun
    Fix Version/s: 2.5.0-rc-3
                   3.0.0-alpha-3
                   2.6.0-alpha-4

Fixed by https://github.com/apache/groovy/commit/5df88c8f05242e828038652b0f6f762fe9b84840

> Instanceof inference does not work on field assigning
> -----------------------------------------------------
>
>                 Key: GROOVY-8355
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8355
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation, Static Type Checker
>            Reporter: Alexey Afanasiev
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 2.6.0-alpha-4, 3.0.0-alpha-3, 2.5.0-rc-3
>
>
> If instanceof inference works as expected [https://issues.apache.org/jira/browse/GROOVY-8293] So probably this code should work to:
> {code}
> import groovy.transform.CompileStatic
> @CompileStatic
> class Foo {
>     Object str = new Object()
>     def bar() {
>         str = "str"
>         str.toUpperCase() // here compile error
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)