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

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

Issue 1170863002: Remove extra CompileTimeErrorCode.DUPLICATE_DEFINITION. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index f27614d91973641bd416bb10ff3df3e28df28144..2fee33496e812e92833f642e7a508937b4f415ce 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -415,6 +415,19 @@ final ListResultDescriptor<AnalysisError> VERIFY_ERRORS =
'VERIFY_ERRORS', AnalysisError.NO_ERRORS);
/**
+ * Remove [CompileTimeErrorCode.DUPLICATE_DEFINITION] errors from the given
+ * [errors] list.
+ */
+void removeDuplicateDefinitionErrors(List<AnalysisError> errors) {
+ if (errors.isNotEmpty) {
+ errors.removeWhere((error) {
+ ErrorCode errorCode = error.errorCode;
+ return errorCode == CompileTimeErrorCode.DUPLICATE_DEFINITION;
+ });
+ }
+}
+
+/**
* A task that builds implicit constructors for a [ClassElement], or keeps
* the existing explicit constructors if the class has them.
*/
@@ -1161,9 +1174,14 @@ class BuildFunctionTypeAliasesTask extends SourceBasedAnalysisTask {
}
}
//
+ // Prepare errors.
+ //
+ List<AnalysisError> errors = errorListener.errors;
+ removeDuplicateDefinitionErrors(errors);
+ //
// Record outputs.
//
- outputs[BUILD_FUNCTION_TYPE_ALIASES_ERRORS] = errorListener.errors;
+ outputs[BUILD_FUNCTION_TYPE_ALIASES_ERRORS] = errors;
outputs[RESOLVED_UNIT3] = unit;
}
@@ -2997,9 +3015,14 @@ class ResolveUnitTypeNamesTask extends SourceBasedAnalysisTask {
library, unitElement.source, typeProvider, errorListener);
unit.accept(visitor);
//
+ // Prepare errors.
+ //
+ List<AnalysisError> errors = errorListener.errors;
+ removeDuplicateDefinitionErrors(errors);
+ //
// Record outputs.
//
- outputs[RESOLVE_TYPE_NAMES_ERRORS] = errorListener.errors;
+ outputs[RESOLVE_TYPE_NAMES_ERRORS] = errors;
outputs[RESOLVED_UNIT4] = unit;
}

Powered by Google App Engine
This is Rietveld 408576698