You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/05/06 08:34:04 UTC

[jira] [Commented] (GROOVY-8157) Flow typing doesn't work with assignment to a parameter

    [ https://issues.apache.org/jira/browse/GROOVY-8157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15999349#comment-15999349 ] 

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

GitHub user shils opened a pull request:

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

    GROOVY-8157: Flow typing doesn't work with assignment to a parameter

    

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

    $ git pull https://github.com/shils/groovy GROOVY-8157

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

    https://github.com/apache/groovy/pull/537.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 #537
    
----
commit f864ead5ca2938d59a08986c5fb02c01dba0f2aa
Author: Shil Sinha <sh...@apache.org>
Date:   2017-05-06T08:32:20Z

    GROOVY-8157: Flow typing doesn't work with assignment to a parameter

----


> Flow typing doesn't work with assignment to a parameter
> -------------------------------------------------------
>
>                 Key: GROOVY-8157
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8157
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 2.4.10
>            Reporter: Daniil Ovchinnikov
>
> {code}
> 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()
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)