-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Is DDC expected to emit static warnings? #36123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Awaiting input from the DDC team (asked @jmesserly and others). |
Hi I'm back from vacation. Currently DDC emits the same messages as its front end (Analyzer or CFE). I don't know to what extent CFE is expected to emit the same warnings as Analyzer. Personally, I don't think we need to test static warnings on DDC, because they're already covered by the other bots, and DDC isn't the one producing those messages. |
Welcome back! ;-) It doesn't actually resolve the issue to determine that DDC/DDK uses a specific front end, or to know whether those warning messages are printed. The issue is whether Currently, where the analyzer does not (yet) use the common front end, and every other tool is expected to report Maybe it's OK to leave this behavior completely untested in the CFE until the analyzer switches over, but it seems reasonable to make that decision, rather than letting it happen by accident. We would then consider the DDC/DDK as "backend-ish" tools, in the sense that |
I just came across this old issue and I'm not sure if it is still an open question or not. I'm not familiar with the term "static warnings" are there any examples of tests that produce some? I can say that there are some static errors that are only generated when compiling for the JavaScript backends and tests for these are run on the dart2js and ddc test configurations. They appear in static error test files marked with the |
I believe we can close this issue as obsolete. I'll mark it as such, but anyone please feel free to reopen if I'm mistaken. Long ago, we used to provide errors and warnings. The language has evolved to mostly provide errors, and our tests mostly provide coverage for errors. Back then, we also only tested for static errors and warnings with tests and multi-tests containing the "compile-time error" and "static type warning" annotations in the outcome comments. We evolved from that, and moved as much of the test coverage for static diagnostics to the Static tests can be run by any configuration, but initially it was only valuable to do so for analyzer and CFE (as the original doc suggests), since they provided all of the diagnostics. Support for web-specific errors was added when we introduced the js-interop transformer. This kernel transformer provides a rich set of errors today and required static coverage. Because of that, now these tests are run by the web backends too. We need to update the docs above to highlight this, though. |
@eernstg noticed that the expectation for tests annotated static warning are only StaticWarning on the analyzer, however the expectation is pass on anything else. He wonders if DDC is supposed to emit static warnings, and thus should have a different expectation. The current logic is in
tools/testing/dart/test_runner.dart
is:Once @eernstg finds out whether DDC is supposed to emit static warnings, then we can change this piece of code to set the right expectation for the tests.
The text was updated successfully, but these errors were encountered: