Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.0-beta-2
-
None
Description
Compilation of the following files:
MyConstants.java
public interface MyConstants { public static final String CONSTANT_1 = "this is constant 1"; }
MyClass.java
public class MyClass implements MyConstants { }
Program.groovy
@groovy.transform.CompileStatic class Program { public static void main(String[] args) { println MyClass.CONSTANT_1 } }
ends with error:
Error:(4, 17) Groovyc: Access to MyClass#CONSTANT_1 is forbidden
For example, the error makes it difficult and counterintuitive to access BaseColumns members via any of content provider contract classes (like ContactsContract) - you need to refer to the interface directly.