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

Unified Diff: pkg/analyzer/test/src/task/strong/strong_test_helper.dart

Issue 1780783002: Don't report redundant type errors in strong mode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Stop type propagation in test. Created 4 years, 9 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/test/src/task/strong/inferred_type_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/strong_test_helper.dart
diff --git a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
index e04fb308c1606490e669ce9c6fca61e3d405e024..e91033eb5cd6bea48a3654df2d7fbba6fe00a12f 100644
--- a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
+++ b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
@@ -87,11 +87,17 @@ CompilationUnit check() {
var librarySource = context.getLibrariesContaining(source).single;
var resolved = context.resolveCompilationUnit2(source, librarySource);
- errors.addAll(context.getErrors(source).errors.where((e) =>
- e.errorCode != HintCode.UNUSED_LOCAL_VARIABLE &&
- // TODO(jmesserly): these are usually intentional dynamic calls.
- e.errorCode.name != 'UNDEFINED_METHOD'));
+ errors.addAll(context.computeErrors(source).where((e) =>
+ // TODO(jmesserly): these are usually intentional dynamic calls.
+ e.errorCode.name != 'UNDEFINED_METHOD' &&
+ // We don't care about any of these:
+ e.errorCode != HintCode.UNNECESSARY_CAST &&
+ e.errorCode != HintCode.UNUSED_ELEMENT &&
+ e.errorCode != HintCode.UNUSED_FIELD &&
+ e.errorCode != HintCode.UNUSED_IMPORT &&
+ e.errorCode != HintCode.UNUSED_LOCAL_VARIABLE &&
+ e.errorCode != TodoCode.TODO));
_expectErrors(resolved, errors);
}
}
« no previous file with comments | « pkg/analyzer/test/src/task/strong/inferred_type_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698