groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Sun (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8595) Expected parameter of type XXX but got YYY static compile error
Date Wed, 23 May 2018 00:10:00 GMT

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

Daniel Sun commented on GROOVY-8595:
------------------------------------

[~jwagenleitner] That's great! call chains, e.g. `a().b().c()` will impact the result of
`inNestedMethodCall()`, so I'm going to rename it to `isSingleMethodCall()` and adjust the
relevant logic.

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

Mime
View raw message