Files
sdk/pkg/front_end/parser_testcases/inline_class/inline_class.dart.expect
T
Paul Berry d579b03f71 [messages] Use withArguments for diagnostics translated by the analyzer.
Changes the `front_end` and `_fe_analyzer_shared` code that reports
the following diagnostics so that it uses `withArguments` rather than
`withArgumentsOld`:

- `expectedButGot`
- `expectedButGot2`
- `expectedAfterButGot`
- `expectedToken`
- `unmatchedToken`
- `constFieldWithoutInitializer`
- `finalFieldWithoutInitializer`
- `superclassHasNoMethod`
- `unavailableDartLibrary`
- `unsupportedPlatformDartLibraryImport`

These messages required special care because they are translated into
analyzer diagnostics by the analyzer method
`FastaErrorReporter.reportByCode`, and the logic to do the translation
depends on the exact parameter names used by the messages.

For some of the messages I've clarified the parameter names and
updated `FastaErrorReporter.reportByCode` accordingly. For others, I
left the parameter names as is.

Change-Id: I6a6a696481c75f4cbb198d1e012aa1ca4294ed61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476323
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-01-30 10:12:42 -08:00

76 lines
3.1 KiB
Plaintext

Problems reported:
parser/inline_class/inline_class:1:1: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
inline class Class {}
^^^^^^
parser/inline_class/inline_class:1:1: Expected ';' after this.
inline class Class {}
^^^^^^
parser/inline_class/inline_class:2:1: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
inline class Class = Object with Mixin;
^^^^^^
parser/inline_class/inline_class:2:1: Expected ';' after this.
inline class Class = Object with Mixin;
^^^^^^
beginCompilationUnit(inline)
beginMetadataStar(inline)
endMetadataStar(0)
beginTopLevelMember(inline)
beginFields(DeclarationKind.TopLevel, null, null, null, null, null, null, null, )
handleRecoverableError(MissingConstFinalVarOrType, inline, inline)
handleNoType()
handleIdentifier(inline, topLevelVariableDeclaration)
handleNoFieldInitializer(class)
handleRecoverableError(Message[Template(ExpectedAfterButGot), Expected ';' after this., null, {expected: ;}], inline, inline)
endTopLevelFields(null, null, null, null, null, null, 1, inline, ;)
endTopLevelDeclaration(;)
beginMetadataStar(class)
endMetadataStar(0)
beginClassOrMixinOrNamedMixinApplicationPrelude(class)
handleIdentifier(Class, classOrMixinDeclaration)
handleNoTypeVariables({)
beginClassDeclaration(class, null, null, null, null, null, null, null, null, Class)
handleNoPrimaryConstructor(Class, null, false)
handleNoType(Class)
handleClassExtends(null, 1)
handleClassNoWithClause()
handleImplements(null, 0)
handleClassHeader(class, class, null)
beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
endClassDeclaration(class, })
endTopLevelDeclaration(})
beginMetadataStar(inline)
endMetadataStar(0)
beginTopLevelMember(inline)
beginFields(DeclarationKind.TopLevel, null, null, null, null, null, null, null, })
handleRecoverableError(MissingConstFinalVarOrType, inline, inline)
handleNoType(})
handleIdentifier(inline, topLevelVariableDeclaration)
handleNoFieldInitializer(class)
handleRecoverableError(Message[Template(ExpectedAfterButGot), Expected ';' after this., null, {expected: ;}], inline, inline)
endTopLevelFields(null, null, null, null, null, null, 1, inline, ;)
endTopLevelDeclaration(;)
beginMetadataStar(class)
endMetadataStar(0)
beginClassOrMixinOrNamedMixinApplicationPrelude(class)
handleIdentifier(Class, classOrMixinDeclaration)
handleNoTypeVariables(=)
beginNamedMixinApplication(class, null, null, null, null, null, null, null, null, Class)
handleIdentifier(Object, typeReference)
handleNoTypeArguments(with)
handleType(Object, null)
beginTypeList(Mixin)
handleIdentifier(Mixin, typeReference)
handleNoTypeArguments(;)
handleType(Mixin, null)
endTypeList(1)
handleNamedMixinApplicationWithClause(with)
endNamedMixinApplication(class, class, =, null, ;)
endTopLevelDeclaration(;)
endCompilationUnit(4, )