Groovy 2.5.0 static compilation problems

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Groovy 2.5.0 static compilation problems

Paolo Di Tommaso
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 and you can replicate the issue with these commands: 

git clone [hidden email]:nextflow-io/nextflow.git && cd nextflow
CI_GROOVY_VERSION=2.5.0-SNAPSHOT make compile



Cheers,
Paolo

Reply | Threaded
Open this post in threaded view
|

Re: Groovy 2.5.0 static compilation problems

Daniel.Sun
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
Daniel Sun
Apache Groovy committer

Blog: http://blog.sunlan.me
Twitter: @daniel_sun
Reply | Threaded
Open this post in threaded view
|

Re: Groovy 2.5.0 static compilation problems

Paolo Di Tommaso
Hi all, 

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



Cheers,
p


On Thu, Jun 7, 2018 at 10:33 AM, Daniel.Sun <[hidden email]> 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