Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.0.0-alpha-8, 4.0.21
-
None
-
None
Description
Consider the following:
package p; public class C extends java.util.HashMap { public void setFoo(Object x) {} protected void setBar(Object x) {} void setBaz(Object x) {} private void setBoo(Object x) {} }
@groovy.transform.CompileStatic void test(p.C p_c) { p_c.foo = null // works p_c.bar = null // SC: Method setBar is protected in p.C p_c.baz = null // IllegalAccessError p_c.boo = null // SC: Cannot call private method p.C#setBoo of class ... }
Prior to GROOVY-11319, each of the non-public references produced error "Cannot access method setBxx(java.lang.Object) from class: p.C" – error improved by GROOVY-11223.