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

Empty statements are not marked as unreachable

XMLWordPrintable

    • merlin
    • generic
    • generic, solaris_2.5.1, solaris_2.6
    • Verified

      Just a semicolon in a method body is a null statement. It has the full status
      of a statement except that it is a noop.

      Hence, the following method should not compile:

      void f() {
        return;;
      }

      The second semicolon is a different statement and is unreachable. There
      should be an error reported that the second semicolon is unreachable.

            gafter Neal Gafter (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: