Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.0-alpha-1
-
None
Description
The folowing snippet:
for (foo in []) {;
}
while a little unusual with the semicolon separating two empty statements (or terminating an empty statement if you look at things that way) should be valid but instead gives:
BUG! exception in phase 'conversion' in source unit 'ConsoleScript12' java.lang.NullPointerException ... Caused by: java.lang.RuntimeException: java.lang.NullPointerException at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:227) ... Caused by: java.lang.NullPointerException at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:37) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106) ...