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

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

Issue 10969070: Support Dynamic type with a prefix. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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/language/import_core_prefix_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 dd9a07863ed5dbe60eedca5ca8e250c459e593af..e943268a7d4dc1a8e86dadcb049f79069376119c 100644
--- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -451,17 +451,21 @@ class PlaceholderCollector extends AbstractVisitor {
}
}
// TODO(antonm): is there a better way to detect unresolved types?
- if (type.element !== compiler.types.dynamicType.element) {
- // Corner case: dart:core type with a prefix.
- // Most probably there are some additional problems with
- // coreLibPrefix.Dynamic and coreLibPrefix.topLevels.
- if (type.element.getLibrary() === coreLibrary && hasPrefix) {
- makeNullPlaceholder(node.typeName.receiver);
- } else {
+ // Corner case: dart:core type with a prefix.
+ // Most probably there are some additional problems with
+ // coreLibPrefix.topLevels.
+ Element typeElement = type.element;
+ Element dynamicTypeElement = compiler.types.dynamicType.element;
+ if (hasPrefix &&
+ (typeElement.getLibrary() === coreLibrary ||
Roman 2012/09/24 15:24:57 if continuation is usually indented by 4 spaces, o
Anton Muhin 2012/09/24 16:00:22 Done.
+ typeElement === dynamicTypeElement)) {
+ makeNullPlaceholder(node.typeName.receiver);
+ } else {
+ if (typeElement !== dynamicTypeElement) {
makeTypePlaceholder(target, type);
+ } else {
+ if (!isDynamicType(node)) makeUnresolvedPlaceholder(target);
}
- } else {
- if (!isDynamicType(node)) makeUnresolvedPlaceholder(target);
}
}
node.visitChildren(this);
« no previous file with comments | « no previous file | tests/language/import_core_prefix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698