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

Unified Diff: pkg/compiler/lib/src/deferred_load.dart

Issue 2620023002: Use elements/types in constants/values (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
Index: pkg/compiler/lib/src/deferred_load.dart
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index 5359f61ba64bb6c00d568eb3e9f11bf44f486ad4..6055e037a75a944f7fc82f54d84cc7919a2c6eb9 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -493,7 +493,8 @@ class DeferredLoadTask extends CompilerTask {
if (constants.contains(constant)) return;
constants.add(constant);
if (constant is ConstructedConstantValue) {
- _mapDependencies(element: constant.type.element, import: import);
+ ClassElement cls = constant.type.element;
+ _mapDependencies(element: cls, import: import);
}
constant.getDependencies().forEach((ConstantValue dependency) {
_mapConstantDependencies(dependency, import);
@@ -798,7 +799,8 @@ class DeferredLoadTask extends CompilerTask {
metadata.ensureResolved(compiler.resolution);
ConstantValue value =
compiler.constants.getConstantValue(metadata.constant);
- Element element = value.getType(compiler.commonElements).element;
+ ResolutionDartType type = value.getType(compiler.commonElements);
+ Element element = type.element;
if (element == deferredLibraryClass) {
reporter.reportErrorMessage(
import, MessageKind.DEFERRED_OLD_SYNTAX);
@@ -1034,7 +1036,8 @@ class _DeclaredDeferredImport implements _DeferredImport {
metadata.ensureResolved(compiler.resolution);
ConstantValue value =
compiler.constants.getConstantValue(metadata.constant);
- Element element = value.getType(compiler.commonElements).element;
+ ResolutionDartType type = value.getType(compiler.commonElements);
+ Element element = type.element;
if (element == compiler.commonElements.deferredLibraryClass) {
ConstructedConstantValue constant = value;
StringConstantValue s = constant.fields.values.single;

Powered by Google App Engine
This is Rietveld 408576698