Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: pkg/analyzer/test/generated/static_type_warning_code_test.dart

Issue 1720083002: Report a static warning if a for loop condition is non-boolean. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | tests/co19/co19-analyzer2.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/static_type_warning_code_test.dart
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
index 5f5d0ef7dd2f38381eb61562cb2e7c8434877b40..137deb568c5f5ebbfad901c3dba35f6892f86d74 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -703,6 +703,16 @@ f() {
verify([source]);
}
+ void test_nonBoolCondition_for() {
+ Source source = addSource(r'''
+f() {
+ for (;3;) {}
+}''');
+ computeLibrarySourceErrors(source);
+ assertErrors(source, [StaticTypeWarningCode.NON_BOOL_CONDITION]);
+ verify([source]);
+ }
+
void test_nonBoolCondition_if() {
Source source = addSource(r'''
f() {
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | tests/co19/co19-analyzer2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698