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

Unified Diff: runtime/vm/object.cc

Issue 137543004: Support bounded mixins in the VM (fix issue 14453). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 31792)
+++ runtime/vm/object.cc (working copy)
@@ -2160,8 +2160,6 @@
void Class::set_super_type(const AbstractType& value) const {
ASSERT(value.IsNull() ||
(value.IsType() && !value.IsDynamicType()) ||
- value.IsTypeRef() ||
- value.IsBoundedType() ||
value.IsMixinAppType());
StorePointer(&raw_ptr()->super_type_, value.raw());
}
@@ -13056,14 +13054,18 @@
const char* TypeParameter::ToCString() const {
- const char* format = "TypeParameter: name %s; index: %d; class: %s";
+ const char* format =
+ "TypeParameter: name %s; index: %d; class: %s; bound: %s";
const char* name_cstr = String::Handle(Name()).ToCString();
const Class& cls = Class::Handle(parameterized_class());
const char* cls_cstr =
cls.IsNull() ? " null" : String::Handle(cls.Name()).ToCString();
- intptr_t len = OS::SNPrint(NULL, 0, format, name_cstr, index(), cls_cstr) + 1;
+ const AbstractType& upper_bound = AbstractType::Handle(bound());
+ const char* bound_cstr = String::Handle(upper_bound.Name()).ToCString();
+ intptr_t len = OS::SNPrint(
+ NULL, 0, format, name_cstr, index(), cls_cstr, bound_cstr) + 1;
char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
- OS::SNPrint(chars, len, format, name_cstr, index(), cls_cstr);
+ OS::SNPrint(chars, len, format, name_cstr, index(), cls_cstr, bound_cstr);
return chars;
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698