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

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

Issue 2401783002: Report CompileTimeErrorCode.DUPLICATE_PART when not only URI, but even Source is the same. (Closed)
Patch Set: Created 4 years, 2 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 d15c36f4d1c243c67ebfc7f0a2fb040d2102e0fb..25bff4608e1a444521557af16007d6f74fd44632 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -1510,7 +1510,7 @@ class BuildLibraryElementTask extends SourceBasedAnalysisTask {
LibraryIdentifier libraryNameNode = null;
String partsLibraryName = _UNKNOWN_LIBRARY_NAME;
bool hasPartDirective = false;
- Set<String> seenPartUris = new Set<String>();
+ Set<Source> seenPartSources = new Set<Source>();
FunctionElement entryPoint =
_findEntryPoint(definingCompilationUnitElement);
List<Directive> directivesToResolve = <Directive>[];
@@ -1534,9 +1534,9 @@ class BuildLibraryElementTask extends SourceBasedAnalysisTask {
partElement.uriEnd = partUri.end;
partElement.uri = directive.uriContent;
//
- // Validate that the part URI is unique in the library.
+ // Validate that the part source is unique in the library.
//
- if (!seenPartUris.add(directive.uriContent)) {
+ if (!seenPartSources.add(partSource)) {
errors.add(new AnalysisError(
librarySource,
partUri.offset,

Powered by Google App Engine
This is Rietveld 408576698