Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.3
-
None
-
None
Description
The following code triggers an InvalidClassChangeError:
class A { static boolean setterCalled = false static protected int x public static void setX(int a) { setterCalled = true x = a } } class B extends A { static void directAccess() { this.@x = 2 } } B.directAccess() assert B.isSetterCalled() == false assert B.x == 2
While this one will trigger an internal compiler error
class A { static protected int x public static void reset() { this.@x = 2 } }
BUG! exception in phase 'class generation' in source unit 'ConsoleScript1' Error while popping argument from operand stack tracker in class A method void reset().
Attachments
Issue Links
- is depended upon by
-
GROOVY-6162 'this' in static context not treated as class by @CompileStatic
- Closed