mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:19:48 +00:00
94b34b2b30
The previous system let you use this to define an "unspecified error": int i = "bad"; // [unspecified error] The marker comment meant that *both* front ends had to report some error on the previous line, but any error at any position was considered acceptable. Unfortunately, this doesn't let us incrementally specify an error for one front end while leaving it unspecified for the other. This means that when, say, the analyzer implementation lands first, we can't pin down its errors while still leaving the CFE errors unspecified until its ready. This addresses that by making "unspecified" a property of each front end, not the error itself. The new syntax is: int i = "bad"; // ^^^ // [analyzer] unspecified // [cfe] unspecified This means the same thing as the previous example: both front ends must report some error on the previous line. The column information is authored as a best effort, but ignored. Now, let's say the CFE implementation lands. The above can be changed to: int i = "bad"; // ^^^ // [analyzer] unspecified // [cfe] Real error message. At this point, the CFE test must report that exact error at that exact position and message. But the analyzer is still free to report any error code anywhere on that line. This syntax is a little more verbose, but it's simpler and more flexible. Change-Id: I37f937d245fd8ec8054acb6128256f9fff6241e1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109728 Auto-Submit: Bob Nystrom <rnystrom@google.com> Commit-Queue: Bob Nystrom <rnystrom@google.com> Reviewed-by: Nicholas Shahan <nshahan@google.com> |
||
---|---|---|
.. | ||
bin | ||
lib/src | ||
test | ||
tool | ||
.gitignore | ||
analysis_options.yaml | ||
pubspec.yaml |