You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Paolo Di Tommaso <pa...@gmail.com> on 2018/06/07 06:03:38 UTC

Groovy 2.5.0 static compilation problems

Dear all,

I'm still getting some weird static problems with groovy 2.5.0 and
2.5.0-SNAPSHOT


* First one:

No such property: instanceId for class: java.util.List <String> @ line 889,
column 16.
           return response.reservation.getInstances() *. instanceId


This looks caused by GROOVY-8595 which is marked resolved but I'm still
getting it. Is it included in the 2.5.0-SNAPSHOT  ?



* Second one:

[Static type checking] - Cannot set read-only property: dynamic @ line 123,
column 53.
    { if (it instanceof Closure) dynamic |=
                                 ^
is given by a piece of code as show below:

@CompileStatic
class Foo {

    boolean dynamic

}

@CompileStatic
class Bar extends Foo  {

    boolean isDynamic() { dynamic }

    def f() {
        def value = []
        value.each { if (it instanceof Closure) dynamic |= true }
    }
}


* Third one:

[Static type checking] - Cannot find matching method
java.lang.Integer#compareTo(java.lang.Object). Please check if the declared
type is correct and if the method exists. @ line 304, column 59.
   line=reader.readLine()) && c++<MAX_LINES
                                 ^
where `c` is a local int variable and MAX_LINES is declared as:

    static private int MAX_LINES = 100


I was not able to isolate it, but the code is here
<https://github.com/nextflow-io/nextflow/blob/e6079575c74a320d61d1e794a24db77baa2890c9/src/main/groovy/nextflow/cli/CmdLog.groovy#L304>
and you can replicate the issue with these commands:

git clone git@github.com:nextflow-io/nextflow.git && cd nextflow
CI_GROOVY_VERSION=2.5.0-SNAPSHOT make compile




Cheers,
Paolo

Re: Groovy 2.5.0 static compilation problems

Posted by Paolo Di Tommaso <pa...@gmail.com>.
Hi all,

I've created an issue for the compile static error reported.

https://issues.apache.org/jira/browse/GROOVY-8640


Cheers,
p


On Thu, Jun 7, 2018 at 10:33 AM, Daniel.Sun <su...@apache.org> wrote:

> It is fix in 2.5.1 and should be available in SNAPSHOT too.
> As you can see, the test in the relevant fix passes, so I suggest you clone
> and build from source code by yourself.
>
> Cheers,
> Daniel.Sun
>
>
>
> -----
> Daniel Sun
> Apache Groovy committer
> Blog: http://blog.sunlan.me
> Twitter: @daniel_sun
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>

Re: Groovy 2.5.0 static compilation problems

Posted by "Daniel.Sun" <su...@apache.org>.
It is fix in 2.5.1 and should be available in SNAPSHOT too.
As you can see, the test in the relevant fix passes, so I suggest you clone
and build from source code by yourself.

Cheers,
Daniel.Sun



-----
Daniel Sun 
Apache Groovy committer 
Blog: http://blog.sunlan.me 
Twitter: @daniel_sun 

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html