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

Unified Diff: lib/src/compiler/nullable_type_inference.dart

Issue 1879373004: Implement modular compilation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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 | « lib/src/compiler/module_builder.dart ('k') | lib/src/compiler/reify_coercions.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/nullable_type_inference.dart
diff --git a/lib/src/codegen/nullable_type_inference.dart b/lib/src/compiler/nullable_type_inference.dart
similarity index 97%
rename from lib/src/codegen/nullable_type_inference.dart
rename to lib/src/compiler/nullable_type_inference.dart
index 562d63d7885ae2b07ca7f55faee12b768adf0691..f930333ed6fd3dbde59e14def4febf222b65e664 100644
--- a/lib/src/codegen/nullable_type_inference.dart
+++ b/lib/src/compiler/nullable_type_inference.dart
@@ -8,7 +8,7 @@ import 'package:analyzer/dart/ast/token.dart' show TokenType;
import 'package:analyzer/dart/ast/visitor.dart' show RecursiveAstVisitor;
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
-import '../utils.dart' show getStaticType, isInlineJS;
+import 'element_helpers.dart' show getStaticType, isInlineJS;
/// An inference engine for nullable types.
///
@@ -21,15 +21,16 @@ import '../utils.dart' show getStaticType, isInlineJS;
// TODO(vsm): Revisit whether we really need this when we get
// better non-nullability in the type system.
abstract class NullableTypeInference {
+ LibraryElement dartCoreLibrary;
bool isPrimitiveType(DartType type);
bool isObjectProperty(String name);
/// Known non-null local variables.
HashSet<LocalVariableElement> _notNullLocals;
- void inferNullableTypesInLibrary(Iterable<CompilationUnit> units) {
+ void inferNullableTypes(AstNode node) {
var visitor = new _NullableLocalInference(this);
- for (var unit in units) unit.accept(visitor);
+ node.accept(visitor);
_notNullLocals = visitor.computeNotNullLocals();
}
@@ -178,9 +179,7 @@ abstract class NullableTypeInference {
}
}
- if (e != null &&
- e.name == 'identical' &&
- e.library.source.uri.toString() == 'dart:core') {
+ if (e?.name == 'identical' && identical(e.library, dartCoreLibrary)) {
return false;
}
}
« no previous file with comments | « lib/src/compiler/module_builder.dart ('k') | lib/src/compiler/reify_coercions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698