3 ms·
No, keywords are banned as identifiers everywhere, not just in ambiguous contexts.
by Macha 7y ago
No, keywords are banned as identifiers everywhere, not just in ambiguous contexts.
- chrisseaton 7y agoI don't believe that's true. boolean isRecordStart() { if (token.kind == IDENTIFIER && token.name() == names.record && (peekToken(TokenKind.IDENTIFIER, TokenKind.LPAREN) || peekToken(TokenKind.IDENTIFIER, TokenKind.LT))) { checkSourceLevel(Feature.RECORDS); return true; } else { return false; } https://github.com/openjdk/amber/blob/4f5927ba8f23c2e40ac467809ef83b7395084355/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L4114-L4122 https://github.com/openjdk/amber/blob/4f5927ba8f23c2e40ac467...