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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart

Issue 359413006: Fix handling of type literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Split visitTypeReferenceSend Created 6 years, 6 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: sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart
index cc7b7e2f2787f7f336e32a97b7fcfe822e6e20c8..0d604cba6571dc13b3ea213bed572dafa6ac05b3 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree_printer.dart
@@ -494,10 +494,14 @@ class TreePrinter {
makeList('.', exp.id.split('.').map(makeIdentifier)));
} else if (exp is LiteralType) {
precedence = TYPE_LITERAL;
+ elements.Element optionalElement = exp.type.element;
result = new tree.Send(
- makeStaticReceiver(exp.element),
+ optionalElement == null ? null : makeStaticReceiver(optionalElement),
makeIdentifier(exp.name));
- setElement(result, exp.element, exp);
+ treeElements.setType(result, exp.type);
+ if (optionalElement != null) { // dynamic does not have an element
+ setElement(result, optionalElement, exp);
+ }
} else if (exp is ReifyTypeVar) {
precedence = PRIMARY;
result = new tree.Send(

Powered by Google App Engine
This is Rietveld 408576698