Files
sdk/pkg/front_end/parser_testcases/patterns/patternVariableDeclaration_topLevel.dart.expect
T
Johnni Winther 0a154753c6 [parser][InternalNodes] Add handlePositionalArgument and handlePositionalRecordField
This [handlePositionalArgument] and [handlePositionalRecordField] methods to the parser listener, allowing listeners to normals arguments and record fields

Change-Id: I3947e196dafffea2ab383f797904c857db8327ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469620
Reviewed-by: Jens Johansen <jensj@google.com>
2026-01-06 02:30:12 -08:00

26 lines
949 B
Plaintext

Problems reported:
parser/patterns/patternVariableDeclaration_topLevel:1:5: A pattern variable declaration may not appear outside a function or method.
var (a, b) = (0, 1);
^^^^^^
beginCompilationUnit(var)
beginMetadataStar(var)
endMetadataStar(0)
beginTopLevelMember(var)
handleRecoverableError(PatternVariableDeclarationOutsideFunctionOrMethod, (, ))
beginFields(DeclarationKind.TopLevel, null, null, null, null, null, null, var, )
handleNoType(var)
handleIdentifier(, topLevelVariableDeclaration)
beginFieldInitializer(=)
beginParenthesizedExpressionOrRecordLiteral(()
handleLiteralInt(0)
handlePositionalRecordField(0)
handleLiteralInt(1)
handlePositionalRecordField(1)
endRecordLiteral((, 2, null)
endFieldInitializer(=, ))
endTopLevelFields(null, null, null, null, null, var, 1, var, ;)
endTopLevelDeclaration(;)
endCompilationUnit(1, )