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

Empty statement before semicolon with parrot parser

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha-1
    • 2.6.0-alpha-1
    • parser
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: