@@ -196,16 +196,6 @@ class ErrorVerifier extends RecursiveAstVisitor<void> {
196
196
EnclosingExecutableContext _enclosingExecutable =
197
197
EnclosingExecutableContext .empty ();
198
198
199
- /// A table mapping name of the library to the export directive which export
200
- /// this library.
201
- final Map <String , LibraryElement > _nameToExportElement =
202
- HashMap <String , LibraryElement >();
203
-
204
- /// A table mapping name of the library to the import directive which import
205
- /// this library.
206
- final Map <String , LibraryElement > _nameToImportElement =
207
- HashMap <String , LibraryElement >();
208
-
209
199
/// A table mapping names to the exported elements.
210
200
final Map <String , Element > _exportedElements = HashMap <String , Element >();
211
201
@@ -547,7 +537,6 @@ class ErrorVerifier extends RecursiveAstVisitor<void> {
547
537
if (exportElement != null ) {
548
538
LibraryElement exportedLibrary = exportElement.exportedLibrary;
549
539
_checkForAmbiguousExport (node, exportElement, exportedLibrary);
550
- _checkForExportDuplicateLibraryName (node, exportElement, exportedLibrary);
551
540
_checkForExportInternalLibrary (node, exportElement);
552
541
_checkForExportLegacySymbol (node);
553
542
}
@@ -788,7 +777,6 @@ class ErrorVerifier extends RecursiveAstVisitor<void> {
788
777
node.prefix, CompileTimeErrorCode .BUILT_IN_IDENTIFIER_AS_PREFIX_NAME );
789
778
}
790
779
if (importElement != null ) {
791
- _checkForImportDuplicateLibraryName (node, importElement);
792
780
_checkForImportInternalLibrary (node, importElement);
793
781
if (importElement.isDeferred) {
794
782
_checkForDeferredImportOfExtensions (node, importElement);
@@ -2283,38 +2271,6 @@ class ErrorVerifier extends RecursiveAstVisitor<void> {
2283
2271
return true ;
2284
2272
}
2285
2273
2286
- /// Verify that the given export [directive] has a unique name among other
2287
- /// exported libraries. The [exportElement] is the [ExportElement] retrieved
2288
- /// from the node, if the element in the node was `null` , then this method is
2289
- /// not called. The [exportedLibrary] is the library element containing the
2290
- /// exported element.
2291
- ///
2292
- /// See [CompileTimeErrorCode.EXPORT_DUPLICATED_LIBRARY_NAME] .
2293
- void _checkForExportDuplicateLibraryName (ExportDirective directive,
2294
- ExportElement exportElement, LibraryElement exportedLibrary) {
2295
- if (exportedLibrary == null ) {
2296
- return ;
2297
- }
2298
- String name = exportedLibrary.name;
2299
- // check if there is other exported library with the same name
2300
- LibraryElement prevLibrary = _nameToExportElement[name];
2301
- if (prevLibrary != null ) {
2302
- if (prevLibrary != exportedLibrary) {
2303
- if (name.isNotEmpty) {
2304
- _errorReporter.reportErrorForNode (
2305
- StaticWarningCode .EXPORT_DUPLICATED_LIBRARY_NAMED , directive, [
2306
- prevLibrary.definingCompilationUnit.source.uri.toString (),
2307
- exportedLibrary.definingCompilationUnit.source.uri.toString (),
2308
- name
2309
- ]);
2310
- }
2311
- return ;
2312
- }
2313
- } else {
2314
- _nameToExportElement[name] = exportedLibrary;
2315
- }
2316
- }
2317
-
2318
2274
/// Check that if the visiting library is not system, then any given library
2319
2275
/// should not be SDK internal library. The [exportElement] is the
2320
2276
/// [ExportElement] retrieved from the node, if the element in the node was
@@ -2771,36 +2727,6 @@ class ErrorVerifier extends RecursiveAstVisitor<void> {
2771
2727
}
2772
2728
}
2773
2729
2774
- /// Verify that the given import [directive] has a unique name among other
2775
- /// imported libraries. The [importElement] is the [ImportElement] retrieved
2776
- /// from the node, if the element in the node was `null` , then this method is
2777
- /// not called.
2778
- ///
2779
- /// See [CompileTimeErrorCode.IMPORT_DUPLICATED_LIBRARY_NAME] .
2780
- void _checkForImportDuplicateLibraryName (
2781
- ImportDirective directive, ImportElement importElement) {
2782
- // prepare imported library
2783
- LibraryElement nodeLibrary = importElement.importedLibrary;
2784
- if (nodeLibrary == null ) {
2785
- return ;
2786
- }
2787
- String name = nodeLibrary.name;
2788
- // check if there is another imported library with the same name
2789
- LibraryElement prevLibrary = _nameToImportElement[name];
2790
- if (prevLibrary != null ) {
2791
- if (prevLibrary != nodeLibrary && name.isNotEmpty) {
2792
- _errorReporter.reportErrorForNode (
2793
- StaticWarningCode .IMPORT_DUPLICATED_LIBRARY_NAMED , directive, [
2794
- prevLibrary.definingCompilationUnit.source.uri,
2795
- nodeLibrary.definingCompilationUnit.source.uri,
2796
- name
2797
- ]);
2798
- }
2799
- } else {
2800
- _nameToImportElement[name] = nodeLibrary;
2801
- }
2802
- }
2803
-
2804
2730
/// Check that if the visiting library is not system, then any given library
2805
2731
/// should not be SDK internal library. The [importElement] is the
2806
2732
/// [ImportElement] retrieved from the node, if the element in the node was
0 commit comments