Files
sdk/pkg/compiler/test
Paul Berry 07c248c6e9 [front end] Use code... instead of message....
This is part of a series of CLs that will standardize CFE error
reporting to always use `codeFoo.withArguments(...)` when reporting
errors that take arguments and `codeFoo` when reporting errors that
don't take arguments, rather than `templateFoo.withArguments(...)`
when reporting errors that take arguments and `messageFoo` when
reporting errors that don't take arguments. This change will have two
advantages:

- It will lend greater consistency to the CFE codebase, by allowing
  the same `code...` objects to be used both to name error codes
  (e.g., in test expectations) and to report errors. This will allow
  everything associated with a certain error code to be found using a
  single invocation of "Find References" in the editor, rather than
  having to search separately for uses of the code and the message or
  template.

- It should hopefully make the experience of writing code that reports
  errors more pleasant, since it will no longer be necessary to look
  up an error to see whether it takes arguments before using it;
  instead, the developer will be able to type the name of the message
  `code...` declaration, and then use autocompletion to see whether
  `.withArguments(...)` is required.

In this CL, references to the `message...` declarations that define
errors are changed to the equivalent `code...` declarations. There is
no functional change, since these declarations denote the same
constant object. In a follow-up CL, the `message...` declarations will
be removed.

Tested: standard trybots
Change-Id: I44d4b3cffb768b908d4341a7851f270db6caa87b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443183
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-08-06 12:16:28 -07:00
..
2025-06-05 13:53:16 -07:00