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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 2235373003: Fix summary handling of unresolved imports, exports, and parts. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Simplify `allowMissingFiles` Created 4 years, 4 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 | « pkg/analyzer/lib/src/dart/resolver/scope.dart ('k') | pkg/analyzer/lib/src/summary/index_unit.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 3f9d3d88b7d17ad618bf660a45f330047d0134ce..cec835498ebd710d9abd819f8f3d5b0ce5811125 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -1918,10 +1918,10 @@ class DeadCodeVerifier extends RecursiveAstVisitor<Object> {
@override
Object visitExportDirective(ExportDirective node) {
ExportElement exportElement = node.element;
- if (exportElement != null && exportElement.uriExists) {
+ if (exportElement != null) {
// The element is null when the URI is invalid
LibraryElement library = exportElement.exportedLibrary;
- if (library != null) {
+ if (library != null && !library.isSynthetic) {
for (Combinator combinator in node.combinators) {
_checkCombinator(exportElement.exportedLibrary, combinator);
}
@@ -1962,11 +1962,11 @@ class DeadCodeVerifier extends RecursiveAstVisitor<Object> {
@override
Object visitImportDirective(ImportDirective node) {
ImportElement importElement = node.element;
- if (importElement != null && importElement.uriExists) {
+ if (importElement != null) {
// The element is null when the URI is invalid, but not when the URI is
// valid but refers to a non-existent file.
LibraryElement library = importElement.importedLibrary;
- if (library != null) {
+ if (library != null && !library.isSynthetic) {
for (Combinator combinator in node.combinators) {
_checkCombinator(library, combinator);
}
@@ -4452,7 +4452,7 @@ class ImportsVerifier {
LibraryElement libraryElement = importElement.importedLibrary;
if (libraryElement == null ||
libraryElement.isDartCore ||
- !importElement.uriExists) {
+ libraryElement.isSynthetic) {
continue;
}
}
@@ -4910,6 +4910,15 @@ class InferenceContext {
}
/**
+ * Look for contextual type information attached to [node]. Returns
+ * the type if found, otherwise null.
+ *
+ * If [node] has a contextual union type like `T | Future<T>` this will be
+ * returned. You can use [getType] if you prefer to only get the `T`.
+ */
+ static DartType getContext(AstNode node) => node?.getProperty(_typeProperty);
+
+ /**
* Look for a single contextual type attached to [node], and returns the type
* if found, otherwise null.
*
@@ -4926,15 +4935,6 @@ class InferenceContext {
}
/**
- * Look for contextual type information attached to [node]. Returns
- * the type if found, otherwise null.
- *
- * If [node] has a contextual union type like `T | Future<T>` this will be
- * returned. You can use [getType] if you prefer to only get the `T`.
- */
- static DartType getContext(AstNode node) => node?.getProperty(_typeProperty);
-
- /**
* Like [getContext] but expands a union type into a list of types.
*/
static Iterable<DartType> getTypes(AstNode node) {
« no previous file with comments | « pkg/analyzer/lib/src/dart/resolver/scope.dart ('k') | pkg/analyzer/lib/src/summary/index_unit.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698