Chromium Code Reviews| 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 01f9495bfa7515a71f9612ee55d58203f7f0d469..83548d3ea3d588680887741b9757afbe4fb3302f 100644 |
| --- a/pkg/analyzer/lib/src/task/dart.dart |
| +++ b/pkg/analyzer/lib/src/task/dart.dart |
| @@ -1510,6 +1510,7 @@ class BuildLibraryElementTask extends SourceBasedAnalysisTask { |
| LibraryIdentifier libraryNameNode = null; |
| String partsLibraryName = _UNKNOWN_LIBRARY_NAME; |
| bool hasPartDirective = false; |
| + Set<String> seenPartUris = new Set<String>(); |
| FunctionElement entryPoint = |
| _findEntryPoint(definingCompilationUnitElement); |
| List<Directive> directivesToResolve = <Directive>[]; |
| @@ -1536,6 +1537,18 @@ class BuildLibraryElementTask extends SourceBasedAnalysisTask { |
| // Validate that the part contains a part-of directive with the same |
|
Paul Berry
2016/10/06 18:18:23
This comment is incorrect.
|
| // name as the library. |
| // |
| + if (!seenPartUris.add(directive.uriContent)) { |
| + errors.add(new AnalysisError( |
| + librarySource, |
| + partUri.offset, |
| + partUri.length, |
| + CompileTimeErrorCode.DUPLICATE_PART, |
| + [directive.uriContent])); |
| + } |
| + // |
| + // Validate that the part contains a part-of directive with the same |
| + // name as the library. |
| + // |
| if (context.exists(partSource)) { |
| String partLibraryName = |
| _getPartLibraryName(partSource, partUnit, directivesToResolve); |