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

Unified Diff: sdk/lib/_internal/compiler/implementation/universe/partial_type_tree.dart

Issue 11412245: MalformedType used for all invalid type annotations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years 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/universe/partial_type_tree.dart
diff --git a/sdk/lib/_internal/compiler/implementation/universe/partial_type_tree.dart b/sdk/lib/_internal/compiler/implementation/universe/partial_type_tree.dart
index a3d74bb2bd75a9dabe73f119506eda0fccb7eb9d..0ffbdde93566294d02a1e60d1457730da9eccdb3 100644
--- a/sdk/lib/_internal/compiler/implementation/universe/partial_type_tree.dart
+++ b/sdk/lib/_internal/compiler/implementation/universe/partial_type_tree.dart
@@ -61,10 +61,18 @@ abstract class PartialTypeTree {
}
// TODO(kasperl): Move this to the Selector class?
+ /**
+ * Returns a [ClassElement] that is an upper bound of the receiver type on
+ * [selector].
+ */
ClassElement selectorType(Selector selector) {
// TODO(ngeoffray): Should the tree be specialized with DartType?
DartType type = selector.receiverType;
if (type == null) return compiler.objectClass;
+ // TODO(kasperl): Should [dynamic] return Object?
+ if (identical(type.kind, TypeKind.MALFORMED_TYPE))
+ return compiler.objectClass;
+ // TODO(johnniwinther): Change to use [DartType.unalias].
if (type.element.isTypedef()) return compiler.functionClass;
return type.element;
}

Powered by Google App Engine
This is Rietveld 408576698