groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fran├žois Guillot <francoisguillo...@gmail.com>
Subject Compile error with 2.4.10
Date Wed, 22 Mar 2017 12:38:02 GMT
H,

I'm switching from Groovy 2.4.7 to 2.4.10 in my project.

I have a compile error with 2.4.10.
Simplified example:
<<

import groovy.transform.CompileStatic
import org.junit.Rule
import org.junit.rules.TestRule

@CompileStatic
trait FooTrait {

    @Rule
    public final TestRule foo = {} as TestRule

}

>>

I get "Error:Groovyc: Access to
com.gradle.ratpack.test.FooTrait$Trait$Helper#$self is forbidden"

Another variant of this error is "Error:Groovyc: Apparent variable '$self'
was found in a static scope but doesn't refer to a local variable, static
field or class."

Is there sth I need to change, or is there a workaround ?

Thanks,

Fran├žois

Mime
View raw message