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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 22849015: Provide a way to get a Type back from a ClassMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: forgot to version the new test... Created 7 years, 4 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: runtime/lib/mirrors_impl.dart
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 88a89cc5a2f220466eb79773bbcc1d36b80ca401..3af32091750365db5aed5803c9feaec124f7c4ca 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -369,6 +369,15 @@ class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl
final Type _reflectedType;
final bool _isGeneric;
+ bool get hasReflectedType => _reflectedType != null;
+ Type get reflectedType {
+ if (_reflectedType == null) {
+ throw new UnsupportedError(
+ "Declarations of generics have no reflected type");
+ }
+ return _reflectedType;
+ }
+
Symbol _simpleName;
Symbol get simpleName {
// dynamic, void and the function types have their names set eagerly in the
@@ -417,7 +426,7 @@ class _LocalClassMirrorImpl extends _LocalObjectMirrorImpl
// Object has no superclass.
return null;
}
- _superclass = reflectClass(supertype);
+ _superclass = _Mirrors._reflectType(supertype);
}
return _superclass;
}

Powered by Google App Engine
This is Rietveld 408576698