Files
sdk/pkg/front_end/parser_testcases/patterns/patternVariableDeclaration_inClass.dart.intertwined.expect
T
Konstantin Shcheglov 4629bff7e9 Augment. Report extensionTypeAugmentationSpecifiesRepresentationField.
Add a syntactic diagnostic for extension type augmentations that declare
representation fields. Extension type augmentations may augment the
declaration, but they must not redeclare the representation.

Thread an explicit parser option through primary constructor parsing so
extension type augmentations can omit a representation without producing
the usual missing-primary-constructor diagnostics, while still reporting
an error when a representation is present.

Register the new diagnostic in the shared and analyzer generated
diagnostic tables and add it to fix status tracking.

Change-Id: I84815bb0669a76126564e590760e93096a3af046
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/505860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-22 17:36:54 -07:00

86 lines
5.3 KiB
Plaintext

parseUnit(class)
skipErrorTokens(class)
listener: beginCompilationUnit(class)
syntheticPreviousToken(class)
parseTopLevelDeclarationImpl(, DirectiveContext(DirectiveState.Unknown))
parseMetadataStar()
listener: beginMetadataStar(class)
listener: endMetadataStar(0)
parseTopLevelKeywordDeclaration(class, , class, null, null, null, DirectiveContext(DirectiveState.Unknown))
parseClassOrNamedMixinApplication(class, null, null, null, null, null, null, null, class)
listener: beginClassOrMixinOrNamedMixinApplicationPrelude(class)
ensureIdentifier(class, classOrMixinDeclaration)
listener: handleIdentifier(C, classOrMixinDeclaration)
listener: handleNoTypeVariables({)
listener: beginClassDeclaration(class, null, null, null, null, null, null, null, C)
parseClass(C, class, class, null, C)
parsePrimaryConstructorOpt(DeclarationKind.Class, C, null, allowExtensionTypeRepresentation: true)
listener: handleNoPrimaryConstructor(DeclarationKind.Class, C, null)
parseClassHeaderOpt(C, class, class)
parseClassExtendsOpt(C, DeclarationHeaderKind.Class)
listener: handleNoType(C)
listener: handleClassExtends(null, 1)
parseClassWithClauseOpt(C)
listener: handleClassNoWithClause()
parseClassOrMixinOrEnumImplementsOpt(C)
listener: handleImplements(null, 0)
listener: handleClassHeader(class, class, null)
parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
notEofOrType(CLOSE_CURLY_BRACKET, var)
parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
parseMetadataStar({)
listener: beginMetadataStar(var)
listener: endMetadataStar(0)
listener: beginMember()
skipOuterPattern(var)
reportRecoverableErrorWithEnd((, ), PatternVariableDeclarationOutsideFunctionOrMethod)
listener: handleRecoverableError(PatternVariableDeclarationOutsideFunctionOrMethod, (, ))
rewriter()
rewriter()
parseFields({, null, null, null, null, null, null, var, var, NoType(), , DeclarationKind.Class, C, true)
listener: beginFields(DeclarationKind.Class, null, null, null, null, null, null, var, {)
listener: handleNoType(var)
ensureIdentifierPotentiallyRecovered(var, fieldDeclaration, true)
listener: handleIdentifier(, fieldDeclaration)
parseFieldInitializerOpt(, , null, null, null, null, var, DeclarationKind.Class, C)
listener: beginFieldInitializer(=)
parseExpression(=)
looksLikeOuterPatternEquals(=)
skipOuterPattern(=)
parsePrecedenceExpression(=, 1, true, ConstantPatternContext.none)
parseUnaryExpression(=, true, ConstantPatternContext.none)
parsePrimary(=, expression, ConstantPatternContext.none)
parseParenthesizedExpressionFunctionLiteralOrRecordLiteral(=, ConstantPatternContext.none)
parseParenthesizedExpressionOrRecordLiteral(=, null, ConstantPatternContext.none)
listener: beginParenthesizedExpressionOrRecordLiteral(()
parseExpression(()
looksLikeOuterPatternEquals(()
skipOuterPattern(()
parsePrecedenceExpression((, 1, true, ConstantPatternContext.none)
parseUnaryExpression((, true, ConstantPatternContext.none)
parsePrimary((, expression, ConstantPatternContext.none)
parseLiteralInt(()
listener: handleLiteralInt(0)
listener: handlePositionalRecordField(0)
parseExpression(,)
looksLikeOuterPatternEquals(,)
skipOuterPattern(,)
parsePrecedenceExpression(,, 1, true, ConstantPatternContext.none)
parseUnaryExpression(,, true, ConstantPatternContext.none)
parsePrimary(,, expression, ConstantPatternContext.none)
parseLiteralInt(,)
listener: handleLiteralInt(1)
listener: handlePositionalRecordField(1)
ensureCloseParen(1, ()
listener: endRecordLiteral((, 2, null)
listener: endFieldInitializer(=, ))
listener: endFields(DeclarationKind.Class, null, null, null, null, null, null, var, 1, var, ;)
listener: endMember()
notEofOrType(CLOSE_CURLY_BRACKET, })
listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
listener: endClassDeclaration(class, })
listener: endTopLevelDeclaration(})
reportAllErrorTokens(class)
listener: endCompilationUnit(1, )