You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "paolo di tommaso (JIRA)" <ji...@apache.org> on 2018/05/30 06:44:00 UTC

[jira] [Reopened] (GROOVY-8595) Expected parameter of type XXX but got YYY static compile error

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

paolo di tommaso reopened GROOVY-8595:
--------------------------------------

The problem is still there when using the spread operator, eg: 
{code:java}

@CompileStatic
class Test {
    List<Foo> foo() {
        return []
    }

    List<String> bar() {
        return foo() *. instanceId
    }
}{code}
 

Tested with 2.5.0 

> 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)