Scala Programming Language
  1. Scala Programming Language
  2. SI-5910

Java parser rejects useless semicolon in syntactically correct Java code

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.2, Scala 2.10.0
    • Fix Version/s: Scala 2.10.0
    • Component/s: Misc Compiler
    • Labels:

      Description

      The following code is rejected by the Scala compiler:

      "J.java"
      public class Bar {  
      };
      

      Results in:

      javasrc/javatest/Bar.java:5: error: illegal start of type declaration
      };
        ^
      

      According to the Java spec, `;` is legal in a type declaration list:

      http://docs.oracle.com/javase/specs/jls/se7/html/jls-7.html#jls-7.6

      The more serious issue is that the Scala compiler stops as soon as it finds syntax errors, so no errors are reported in Scala sources that come afterwards.

        Activity

        Show
        Adriaan Moors added a comment - https://github.com/scala/scala/pull/723

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Iulian Dragos
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development