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

Unified Diff: sdk/lib/mirrors/mirrors.dart

Issue 24005002: Make TypedefMirror a direct descendant of TypeMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 2 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/mirrors/mirrors.dart
diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart
index 0b9ebe52901ad6e493209ce56976a73721e9e9c7..ddf175bf1033491371ddf94188cd8a74f4305d54 100644
--- a/sdk/lib/mirrors/mirrors.dart
+++ b/sdk/lib/mirrors/mirrors.dart
@@ -135,8 +135,8 @@ external InstanceMirror reflect(Object reflectee);
* This function returns a [ClassMirror] reflecting *C*.
*
* If [key] is not an instance of [Type] then this function
- * throws an [ArgumentError]. If [key] is the Type dynamic,
- * throws an [ArgumentError] because dynamic is not a class.
+ * throws an [ArgumentError]. If [key] is the Type for dynamic
+ * or a function typedef, throws an [ArgumentError].
*
* Note that since one cannot obtain a [Type] object from
* another isolate, this function can only be used to
@@ -145,6 +145,19 @@ external InstanceMirror reflect(Object reflectee);
external ClassMirror reflectClass(Type key);
/**
+ * This function returns a [TypeMirror] reflecting the type
+ * represented by [key].
+ *
+ * If [key] is not an instance of [Type] then this function
+ * throws an [ArgumentError].
+ *
+ * Note that since one cannot obtain a [Type] object from
+ * another isolate, this function can only be used to
+ * obtain type mirrors on types of the current isolate.
+ */
+external TypeMirror reflectType(Type key);
+
+/**
* A [Mirror] reflects some Dart language entity.
*
* Every [Mirror] originates from some [MirrorSystem].
@@ -656,6 +669,12 @@ abstract class LibraryMirror implements DeclarationMirror, ObjectMirror {
Map<Symbol, ClassMirror> get classes;
/**
+ * An immutable map from names to mirrors for all type
+ * declarations in this library.
+ */
+ Map<Symbol, TypeMirror> get types;
+
+ /**
* An immutable map from names to mirrors for all function, getter,
* and setter declarations in this library.
*/
@@ -720,8 +739,7 @@ abstract class ClassMirror implements TypeMirror, ObjectMirror {
/**
* A mirror on the superclass on the reflectee.
*
- * If this type is [:Object:] or a typedef, the superClass will be
- * null.
+ * If this type is [:Object:], the superclass will be null.
*/
ClassMirror get superclass;
@@ -954,13 +972,13 @@ abstract class TypeVariableMirror extends TypeMirror {
/**
* A [TypedefMirror] represents a typedef in a Dart language program.
*/
-abstract class TypedefMirror implements ClassMirror {
+abstract class TypedefMirror implements TypeMirror {
/**
* The defining type for this typedef.
*
- * For instance [:void f(int):] is the value for [:typedef void f(int):].
+ * For instance [:void f(int):] is the referent for [:typedef void f(int):].
*/
- TypeMirror get value;
+ TypeMirror get referent;
}
/**

Powered by Google App Engine
This is Rietveld 408576698