Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have the following program:
class A<T> { T p } @groovy.transform.CompileStatic void test() { def x = { -> new A<String>() } def y = x() def z = y.p y = null // changes inferred type } test()
Actual behaviour
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
test.groovy: 9: Access to java.lang.Object#f is forbidden @ line 8, column 13.
def z = y.p
^
1 error
Expected behaviour
Compile successfully
Tested against master