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

15.8.2: Remove mention of scope for a class literal

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8
    • specification

      JLS 15.8.2 has long said that the TypeName in TypeName.class must denote a type that is accessible (§6.6) and in scope (§6.3) at the point where the class literal appears. However, the scope clause is redundant: either the TypeName is simple, in which case 6.5.5.1 already mandates an in-scope name, or the TypeName is qualified, in which case scope is irrelevant. Removing the scope clause will align with other rules that inspect a TypeName, such as 9.7.1's inspection of the TypeName in @TypeName(...).

            abuckley Alex Buckley
            abuckley Alex Buckley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: