Inherited variable hiding from outer class does not cause error

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.2.0
    • Component/s: tools
    • generic
    • solaris_2.5.1

      The compiler is supposed to signal an error if an inherited variable
      hides an up-level one. This code is in error, although a bug injavac
      permits it:
              class A_ {
                  int x;
              }
              class A {
                  int x;
                  class B extends A/*_*/ {
                      B() {
                          System.out.println(x);
                      }
                  }
              }
       
      (If you change "A/*_*/" to "A_", you'll get the correct diagnostic
      from javac.)

            Assignee:
            William Maddox (Inactive)
            Reporter:
            David Stoutamire (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: