Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.0-rc-2
-
None
-
None
Description
Follow up to GROOVY-9332 and GROOVY-9333. Consider the following:
@groovy.transform.CompileStatic class Test1 { static int acc = 1 static { [1, 2, 3].forEach((Integer i) -> acc += i) } } assert Test1.acc == 7
java.lang.ExceptionInInitializerError\r\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n at java.lang.reflect.Method.invoke(Method.java:498)\r\n
Attachments
Issue Links
- links to