Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.6
-
None
-
None
Description
I'm getting a NPE when running this snippet:
@groovy.transform.CompileStatic class LazyMap implements Map<String,Object> { @Delegate protected Map<String,Object> target LazyMap() { target = new HashMap<>() } } @groovy.transform.CompileStatic class TaskConfig extends LazyMap implements Cloneable { TaskConfig() { } TaskConfig clone() { def copy = (TaskConfig)super.clone() copy.target = new HashMap<>(this.target) return copy } }
The problem is that `this.target` in the clone method is evaluated to `null`. It works fine if the classes are not declared CompileStatic. It was also working fine with groovy version prior to 2.5.6.