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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • 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.

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

              Created:
              Updated:
              Resolved: