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

compiler fails to allow access to enclosing instance in super()

    Details

    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      generic
    • OS:
      solaris_8
    • Verification:
      Verified

      Description

      The following test case, fails to compile cleanly as it should. Perhaps this is
      due to the lookup finding the private one hiding the one from the enclosing scope.
      See also 4717593.

      /**
       * @test @(#)WhichImplicitThis6.java 1.1 02/07/19
       * @bug 4717633
       * @summary compiler fails to allow access to enclosing instance in super()
       *
       * @compile WhichImplicitThis6.java
       */

      class WhichImplicitThis6 {
          private int i;
          WhichImplicitThis6(int i) {}
          class Sub extends WhichImplicitThis6 {
              Sub() {
                  super(i); // i is not inherited, so it is the enclosing i
              }
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              gafter Neal Gafter
              Reporter:
              gafter Neal Gafter
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: