Hi, I've tested (with Java 11) the latest beta-2 version of groovy 3 but unfortunately the problem I reported some weeks ago on the users mailing list is still in place (up until alpha-4 everything works correctly). The compiler complains when inside a closure one try to access a public field without a getter. For convenience I copy the same simple script to reproduce the problem:
""" import groovy.transform.CompileStatic @CompileStatic class Foo { public float field1 = 1; } @CompileStatic class Main { static public void main(String... args) { var cl = { Foo foo = new Foo() assert foo.field1 == 1 } } } Main.main() """ The error logged is cryptic: /path/to/test.groovy: -1: Access to Foo#foo is forbidden @ line -1, column -1. Kind regards, M On Sun, Jul 14, 2019 at 5:39 PM Daniel.Sun <sun...@apache.org> wrote: > > Note: Apache Groovy 3.0.0-beta-2 was compiled with JDK8, so the illegal > access warnings will come back if you use JDK9+. > > If you want to try Groovy 3.0.0-beta-2 with JDK9+ and do not want to see > the > illegal access warnings, you can download the source code and build by > yourself: > > 1) Download the source code from the page: > > http://www.apache.org/dyn/closer.cgi/groovy/3.0.0-beta-2/sources/apache-groovy-src-3.0.0-beta-2.zip > 2) Unzip the zip file "apache-groovy-src-3.0.0-beta-2.zip" > 3) Run `gradle installGroovy` (Require gradle 5.5 and JDK9+ to build) > 4) Get the distribution from the generated directory "install" > > Cheers, > Daniel.Sun > > > > > ----- > Apache Groovy committer & PMC member > Blog: http://blog.sunlan.me > Twitter: @daniel_sun > > -- > Sent from: http://groovy.329449.n5.nabble.com/Groovy-Users-f329450.html >