Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.8, 3.0.0-beta-3
-
None
Description
bugs.ScriptMain.groovy:
package bugs import groovy.transform.CompileStatic @CompileStatic public class ScriptMain { static void method(Closure closureToInvoke) { closureToInvoke.run() } public static void main(String[] args) { method({ def obj = new ClassWithInnerClass.InnerClass() println obj.field }) } }
bugs.ClassWithInnerClass.java:
package bugs; public class ClassWithInnerClass { public static class InnerClass { public int field = 123; } }
Errors out with:
Access to bugs.ClassWithInnerClass$InnerClass#obj is forbidden @ line 14, column 21. println obj.field
This works fine on groovy 2.5.6. But does not work neither 2.5.7, 2.5.8 nor 3.0.0-beta-3.
This appears highly related to GROOVY-9005. However from what I can see that regression happens on 2.5.6 not on 2.5.7.
Attachments
Issue Links
- relates to
-
GROOVY-9005 SomeClass.groovy: -1: Access to java.lang.Object#this is forbidden @ line -1, column -1
- Closed
- links to