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

Parser regression in JDK 8 when compiling super.x

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8, 8-repo-lambda
    • Fix Version/s: 8
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b93
    • Verification:
      Verified

      Description

      The following code will fail to compile:

      class A {
        int b = 1;
      }

      class B extends A {
        int b = 12;

        int m() { return(super.b); } //<------------

        public static void main(String[] args) {
            System.out.println(new B().m());
        }
      }

      Output:

      Bug.java:8: error: illegal start of type
        int m() { return(super.b); }
                         ^
      Bug.java:8: error: illegal start of expression
        int m() { return(super.b); }
                              ^
      Bug.java:8: error: ';' expected
        int m() { return(super.b); }
                               ^
      Bug.java:8: error: illegal start of expression
        int m() { return(super.b); }
                                ^
      4 errors

        Attachments

          Activity

            People

            • Assignee:
              mcimadamore Maurizio Cimadamore
              Reporter:
              mcimadamore Maurizio Cimadamore
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: