Compiler restricts label hiding unnecessarily

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 1.4.0
    • Affects Version/s: 1.3.0
    • Component/s: tools
    • beta
    • generic
    • generic
    • Verified

      The 1.3 compiler rejects the following:


      class labelHiding {

          {i: {class Nested { { i: ;}}}}
      }

       
      This code is accepted by 1.2.

      Note that there is no real connection between the label inside the method or
      initializer and the label in the nested class.

      JLS 2nd edition (draft) states that:

      Let l be a label, and let m be the immediately enclosing method, instance initializer or static initializer. It is a compile time error if l hides the declaration of another label immediately enclosed in m.

      gilad.bracha@eng 2000-02-01

            Assignee:
            Btplusnull User (Inactive)
            Reporter:
            Gilad Bracha (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: