[lworld] Javac's handling of `primitive' modifier is unlike the handling of other restricted identifiers

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • repo-valhalla
    • Affects Version/s: repo-valhalla
    • Component/s: tools
    • generic
    • generic

      ATM, javac's treatment of 'primitive' modifier employs a completely parallel scheme - unlike the other restricted identifiers (JLS 3.8) and needs to be harmonized.

      See the methods

      com.sun.tools.javac.parser.JavacParser#recastToken
      com.sun.tools.javac.parser.JavacParser#restrictedTypeName
      com.sun.tools.javac.parser.JavacParser#restrictedTypeNameStartingAtSource

      ATM, none of yield, sealed, var, record etc have an Token kind
      in com.sun.tools.javac.parser.Tokens.TokenKind while primitive
      does

      We may also not be emitting the pertinent diagnostics from this set:

      IllegalRefToRestrictedType
      RestrictedTypeNotAllowed
      RestrictedTypeNotAllowedArray
      RestrictedTypeNotAllowedCompound
      RestrictedTypeNotAllowedHere
      RestrictedTypeNotAllowedPreview

      etc.

      Both the spec and the implementation wrt to other restricted identifiers must be studied and the implementation must be aligned.

            Assignee:
            Srikanth Adayapalam (Inactive)
            Reporter:
            Srikanth Adayapalam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: