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

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..2028b421ebefee744a2e1399a25a7b65fd243dac 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 ||
+ 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