Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8161

Empty statement before semicolon with parrot parser

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0-alpha-1
    • Fix Version/s: 2.6.0-alpha-1
    • Component/s: parser
    • Labels:
      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)
      ...
      

        Attachments

          Activity

            People

            • Assignee:
              daniel_sun Daniel Sun
              Reporter:
              paulk Paul King
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: