Instance access through types not allowed

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 1.2.0
    • Affects Version/s: 1.1.2, 1.1.3
    • Component/s: tools
    • None
    • 1.2beta2
    • generic, x86, sparc
    • solaris_2.5, solaris_2.5.1, windows_95
    • Not verified

      javac allows instance access through types (like C++), but the JLS explicitly
      disallows this. This is one of the many ways Java is better than C++ and it
      will be great if javac can also be simplified likewise.

      Example:

      class C {

        int x;

        int y = C.x;

      }

      The reference to x as C.x is illegal, but javac allows it.

            Assignee:
            David Stoutamire (Inactive)
            Reporter:
            J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: