Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.7
-
None
Description
The following code works fine in 2.5.6 but breaks in 2.5.7:
import groovy.transform.CompileStatic @CompileStatic class Class1 { public String prop1 } @CompileStatic class Class2 { String doThing(Class1 c1) { return 'something'.with { println c1.prop1 return it } } } new Class2().doThing(new Class1(prop1: 'value1'))
The error is
Access to Class1#c1 is forbidden at line: -1, column: -1
Note that if you remove the `public` modifier from `Class1.prop1` the code is fine. Likewise, if you take `@CompileStatic` off of `Class2`, everything works fine.