Skip to content

Commit c7b5016

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
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>
1 parent 867d653 commit c7b5016

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

pkg/test_runner/lib/src/command_output.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,10 @@ mixin _StaticErrorOutput on CommandOutput {
11931193
? error.isAnalyzer
11941194
: error.isCfe);
11951195

1196-
var validation = StaticError.validateExpectations(expected, errors);
1196+
var validation = StaticError.validateExpectations(
1197+
expected,
1198+
[...errors, ...warnings],
1199+
);
11971200
if (validation == null) return Expectation.pass;
11981201

11991202
writer?.subsection("static error failures");

tests/language_2/variable/inst_field_initializer1_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class A {
1010
// ^
1111
// [analyzer] COMPILE_TIME_ERROR.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER
1212
// [cfe] Can't access 'this' in a field initializer to read 'x'.
13+
// ^
14+
// [analyzer] STATIC_WARNING.TOP_LEVEL_INSTANCE_GETTER
1315
}
1416

1517
void main() {

0 commit comments

Comments
 (0)