Validate not only errors, but also warnings.

Change-Id: I2c03711061ccd40d1609cf9148f3169b4df847d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135600
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Konstantin Shcheglov 2020-02-13 21:31:59 +00:00 committed by commit-bot@chromium.org
parent 867d6537df
commit c7b501625e
2 changed files with 6 additions and 1 deletions

View file

@ -1193,7 +1193,10 @@ mixin _StaticErrorOutput on CommandOutput {
? error.isAnalyzer
: error.isCfe);
var validation = StaticError.validateExpectations(expected, errors);
var validation = StaticError.validateExpectations(
expected,
[...errors, ...warnings],
);
if (validation == null) return Expectation.pass;
writer?.subsection("static error failures");

View file

@ -10,6 +10,8 @@ class A {
// ^
// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER
// [cfe] Can't access 'this' in a field initializer to read 'x'.
// ^
// [analyzer] STATIC_WARNING.TOP_LEVEL_INSTANCE_GETTER
}
void main() {