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

Unified Diff: lib/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 10854218: dart2dart Collect type placeholder for default class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/placeholder_collector.dart
diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
index 9c4d614a767db57974c71055974545ef4d29bc0c..e4813c71903645dea9d6e8e612ea50e4205624be 100644
--- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -414,6 +414,14 @@ class PlaceholderCollector extends AbstractVisitor {
assert(currentElement is ClassElement);
makeElementPlaceholder(node.name, currentElement);
node.visitChildren(this);
+ if (node.defaultClause !== null) {
+ // Can't just visit class node's default clause because of the bug in the
+ // resolver, it just crashes when it meets type variable.
+ Type defaultType = (currentElement as ClassElement).defaultClass;
+ assert(defaultType !== null);
+ makeTypePlaceholder(node.defaultClause.typeName, defaultType);
+ visit(node.defaultClause.typeArguments);
+ }
}
visitTypedef(Typedef node) {
« no previous file with comments | « no previous file | tests/compiler/dart2js/unparser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698