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

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

GitHub user danielsun1106 opened a pull request:

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

    Refine GROOVY-8595: Fix type inference of method call in property exp…

    …ression

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

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

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

    https://github.com/apache/groovy/pull/739.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 #739
    
----
commit 6b241318ebe3b1f78364d3e920deeddf6782cbc4
Author: Daniel Sun <realbluesun@...>
Date:   2018-06-01T07:59:52Z

    Refine GROOVY-8595: Fix type inference of method call in property expression

----


> Expected parameter of type XXX but got YYY static compile error
> ---------------------------------------------------------------
>
>                 Key: GROOVY-8595
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8595
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 2.5.0-rc-3
>            Reporter: paolo di tommaso
>            Assignee: John Wagenleitner
>            Priority: Major
>             Fix For: 2.6.0-alpha-4, 3.0.0-alpha-3, 2.5.0
>
>
> The following code report a compilation error:
> {code:java}
> @CompileStatic
> class Test {
>   List<Foo> foo() {
>     return []
>   }
>   List<String> bar() {
>     return foo().collect { Foo it -> it.instanceId }
>   }
> }
> @CompileStatic
> class Foo {
>   String instanceId
> }{code}
>  
> Error message
> {code:java}
> Test.groovy: 36: Expected parameter of type java.lang.String but got 
> nextflow.Foo
> @ line 36, column 32.
>            return foo().collect { Foo it -> it.instanceId }
>                                   ^
> Test.groovy: 36: [Static type checking] - No such property: instanceId for 
> class: java.lang.String
> @ line 36, column 42.
>    urn foo().collect { Foo it -> it.instanc{code}



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

Reply via email to