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

Unified Diff: runtime/lib/mirrors.cc

Issue 103913005: Introduce class TypeRef in the VM to fully support recursive types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « pkg/pkg.status ('k') | runtime/lib/type_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
===================================================================
--- runtime/lib/mirrors.cc (revision 31085)
+++ runtime/lib/mirrors.cc (working copy)
@@ -336,6 +336,7 @@
ASSERT(!cls.IsDynamicClass() && !cls.IsVoidClass());
ASSERT(!type.IsNull());
ASSERT(type.IsFinalized());
+ ASSERT(!type.IsTypeRef());
if (cls.IsSignatureClass()) {
if (cls.IsCanonicalSignatureClass()) {
@@ -382,6 +383,7 @@
static RawInstance* CreateTypeMirror(const AbstractType& type) {
ASSERT(type.IsFinalized());
ASSERT(!type.IsMalformed());
+ ASSERT(!type.IsTypeRef());
if (type.HasResolvedTypeClass()) {
const Class& cls = Class::Handle(type.type_class());
// Handle void and dynamic types.
@@ -1274,6 +1276,7 @@
const intptr_t num_inherited_args = args.Length() - num_params;
for (intptr_t i = 0; i < num_params; i++) {
arg_type ^= args.TypeAt(i + num_inherited_args);
+ arg_type = arg_type.Canonicalize(); // Necessary for recursive types.
type_mirror = CreateTypeMirror(arg_type);
result.SetAt(i, type_mirror);
}
« no previous file with comments | « pkg/pkg.status ('k') | runtime/lib/type_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698