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

reports non-ambiguous field access as ambiguous

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.2.0
    • 1.1, 1.1.4, 1.2.0
    • tools
    • 1.2beta3
    • generic, x86
    • generic, windows_95
    • Not verified



      Name: mc57594 Date: 05/21/97


      According to the rules for field access and expression
      names, the following access to i in B is not ambiguous. The reason is
      that although there are two i's in B, only one of them is accessible, so
      there is no ambiguity.

      package here;

      interface I {
          int i = 5; // public
      }

      public class Test {
          static int i = 6; // default
      }

      public class B extends Test implements I {
          // inherits a public i and a default i
      }

      package there;

      class D extends here.B {
          { System.out.println(here.B.i); }
          // JLS implies this is NOT ambiguous
          // javac says it IS ambiguous!
      }
      ======================================================================

            tturnidgsunw Todd Turnidge (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: