rustc: Make object methods into interior vectors

This commit is contained in:
Patrick Walton 2011-07-04 19:06:27 -07:00
parent 0391e14fc2
commit 2e1aa04fcd
4 changed files with 49 additions and 45 deletions

View file

@ -133,9 +133,10 @@ fn ty_to_str(&ctxt cx, &t typ) -> str {
ast::return, ~[]);
}
case (ty_obj(?meths)) {
auto f = bind method_to_str(cx, _);
auto m = vec::map[method, str](f, meths);
s += "obj {\n\t" + str::connect(m, "\n\t") + "\n}";
// TODO: Remove this ivec->vec conversion.
auto strs = [];
for (method m in meths) { strs += [method_to_str(cx, m)]; }
s += "obj {\n\t" + str::connect(strs, "\n\t") + "\n}";
}
case (ty_res(?id, _, _)) {
s += "<resource#" + int::str(id._0) + ":" + int::str(id._1) + ">";