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

Unified Diff: pkg/analyzer/lib/src/task/strong/checker.dart

Issue 2786993002: Convert top-level inference errors to hints (Closed)
Patch Set: Preserve the new hints Created 3 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/lib/src/error/codes.dart ('k') | pkg/analyzer/test/generated/hint_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/strong/checker.dart
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
index 463a5c2ce22853a0ea2babc5a06cd94d1b600e59..aabbfa68d8fd7a63fc12c9853ce3a9fc67323b86 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -1047,7 +1047,13 @@ class CodeChecker extends RecursiveAstVisitor {
var severity =
(processor != null) ? processor.severity : errorCode.errorSeverity;
- if (severity == ErrorSeverity.ERROR) _failure = true;
+ if (errorCode.type == ErrorType.HINT &&
+ errorCode.name.startsWith('STRONG_MODE_TOP_LEVEL_')) {
+ severity = ErrorSeverity.ERROR;
+ }
+ if (severity == ErrorSeverity.ERROR) {
+ _failure = true;
Leaf 2017/03/30 19:39:59 I don't think we want to set _failure for these er
Brian Wilkerson 2017/03/30 19:45:18 Done
+ }
if (severity != ErrorSeverity.INFO || _options.strongModeHints) {
int begin = node is AnnotatedNode
? node.firstTokenAfterCommentAndMetadata.offset
« no previous file with comments | « pkg/analyzer/lib/src/error/codes.dart ('k') | pkg/analyzer/test/generated/hint_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698