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

Unified Diff: runtime/lib/mirrors.cc

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
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | sdk/lib/mirrors/mirrors.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 7ab68b6a0c650a8e397e785e62f31e4daa7eccca..a6ba2999c8309962ae8c90379ff1c91506376b7c 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -305,9 +305,16 @@ DEFINE_NATIVE_ENTRY(Mirrors_makeLocalClassMirror, 1) {
GET_NON_NULL_NATIVE_ARGUMENT(Type, type, arguments->NativeArgAt(0));
const Class& cls = Class::Handle(type.type_class());
ASSERT(!cls.IsNull());
- return CreateClassMirror(cls,
- AbstractType::Handle(),
- Instance::null_instance());
+ // Strip the type for generics only.
+ if (cls.NumTypeParameters() == 0) {
+ return CreateClassMirror(cls,
+ type,
+ Instance::null_instance());
+ } else {
+ return CreateClassMirror(cls,
+ AbstractType::Handle(),
+ Instance::null_instance());
+ }
}
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | sdk/lib/mirrors/mirrors.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698