Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
class Foo{ private Foo(){} } @CompileStatic class Bar { def foo(){new Foo()} }
This fails with
java.lang.IllegalAccessError: tried to access method Foo.<init>()V from class Bar
The reason is that @TypeChecked makes no accessiblity check, but @CompileStatic needs that. In case of methods it fails, because StaticInvocationWriter is doing the check. Better would be to check during method selection already, because another accessible member might be missed otherwise (see GROOVY-6632 for this)
Attachments
Issue Links
- is related to
-
GROOVY-6632 CompileStatic selects wrong constructor when GString is a parameter
- Closed