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

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

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16475689#comment-16475689 ]

ASF GitHub Bot commented on GROOVY-8355:
----------------------------------------

GitHub user danielsun1106 opened a pull request:

    https://github.com/apache/groovy/pull/706

    GROOVY-8355: Instanceof inference does not work on field assigning

   

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/danielsun1106/groovy GROOVY-8355

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/706.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #706
   
----
commit cdf254c3814415bebba622da43f2e5243cfdbcf5
Author: Daniel Sun <realbluesun@...>
Date:   2018-05-15T11:34:24Z

    GROOVY-8355: Instanceof inference does not work on field assigning

----


> 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
>            Priority: Major
>
> 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)