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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/deferred_load.dart

Issue 15096006: Handle constants that mix eager and deferred types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix comment Created 7 years, 7 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 | dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/deferred_load.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/deferred_load.dart b/dart/sdk/lib/_internal/compiler/implementation/deferred_load.dart
index 31abe4373f71efcd57341bf449bba1c922d71ea9..abcf627fabd9011a41d36d4df4de5f8ff9a8d6d0 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/deferred_load.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/deferred_load.dart
@@ -164,8 +164,10 @@ class DeferredLoadTask extends CompilerTask {
Set<Element> result = new LinkedHashSet<Element>();
if (element.isGenerativeConstructor()) {
// When instantiating a class, we record a reference to the
- // constructor, not the class itself.
- element = element.getEnclosingClass().implementation;
+ // constructor, not the class itself. We must add all the
+ // instance members of the constructor's class (see below).
+ result.addAll(
+ allElementsResolvedFrom(element.getEnclosingClass().implementation));
}
if (element.isClass()) {
// If we see a class, add everything its instance members refer
@@ -187,7 +189,8 @@ class DeferredLoadTask extends CompilerTask {
result.add(type.element.implementation);
}
result.add(cls.implementation);
- } else if (Elements.isStaticOrTopLevel(element)) {
+ } else if (Elements.isStaticOrTopLevel(element)
+ || element.isConstructor()) {
result.addAll(DependencyCollector.collect(element, compiler));
}
// Other elements, in particular instance members, are ignored as
@@ -248,7 +251,7 @@ class DependencyCollector extends Visitor {
visitNode(Node node) {
node.visitChildren(this);
Element dependency = elements[node];
- if (dependency == null) return;
+ if (Elements.isUnresolved(dependency)) return;
dependencies.add(dependency.implementation);
}
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698