Sort methods in object types.

This commit is contained in:
Graydon Hoare 2010-12-21 16:43:28 -08:00
parent 744b164b7d
commit 3504f4a4bf
2 changed files with 32 additions and 0 deletions

View file

@ -248,6 +248,13 @@ fn collect_item_types(@ast.crate crate) -> tup(@ast.crate, @ty_table) {
auto methods =
_vec.map[@ast.method,method](f, obj_info.methods);
fn method_lteq(&method a, &method b) -> bool {
ret _str.lteq(a.ident, b.ident);
}
methods = std.sort.merge_sort[method](bind method_lteq(_,_),
methods);
auto t_obj = plain_ty(ty.ty_obj(methods));
ret t_obj;
}