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/summary/prelink.dart

Issue 2655713002: Fix prelinker when a local name shadows an import prefix. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | pkg/analyzer/test/generated/compile_time_error_code_driver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/prelink.dart
diff --git a/pkg/analyzer/lib/src/summary/prelink.dart b/pkg/analyzer/lib/src/summary/prelink.dart
index 062676ee924d98a48bba11d8532392171bfd8492..489bd351d7af7e9574137196db1123316db41c13 100644
--- a/pkg/analyzer/lib/src/summary/prelink.dart
+++ b/pkg/analyzer/lib/src/summary/prelink.dart
@@ -351,6 +351,11 @@ class _Prelinker {
void filterExportNamespace(String relativeUri,
List<UnlinkedCombinator> combinators, Map<String, _Meaning> result) {
Map<String, _Meaning> exportNamespace = computeExportNamespace(relativeUri);
+ if (result == null) {
+ // This can happen if the import prefix was shadowed by a local name, so
+ // the imported symbols are inaccessible.
+ return;
+ }
NameFilter filter = new NameFilter.forUnlinkedCombinators(combinators);
exportNamespace.forEach((String name, _Meaning meaning) {
if (filter.accepts(name) && !result.containsKey(name)) {
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/compile_time_error_code_driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698