Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8338301

Error recovery and reporting should be improved for erroneous implicitly declared classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 24
    • 23, 24
    • tools
    • None
    • b14

      Consider code like:
      ---
      main() {}
      ---

      this will produce:
      ---
      $ javac --enable-preview --source 24 /tmp/F.java
      /tmp/F.java:1: error: class, interface, enum, or record expected
      main() {}
      ^
      1 error
      ---

      while the real problem is that the `main` method is missing a return type.

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: