Generic classes and generic class methods work cross-crate

Classes can have ty params now. So can methods inside classes.
That was probably true before, but now it should still work if you
call methods in a class that's defined in a different crate. Yay!
This commit is contained in:
Tim Chevalier
2012-04-10 10:52:06 -07:00
parent b2ec26c152
commit fd26743bed
19 changed files with 216 additions and 82 deletions

View File

@@ -14,6 +14,8 @@ export noop_fold_ty;
export noop_fold_block;
export wrap;
export fold_ty_param;
export fold_ty_params;
export fold_fn_decl;
type ast_fold = @mut a_f;
@@ -270,10 +272,12 @@ fn noop_fold_item_underscore(i: item_, fld: ast_fold) -> item_ {
item_class(typms, items, ctor) {
let ctor_body = fld.fold_block(ctor.node.body);
let ctor_decl = fold_fn_decl(ctor.node.dec, fld);
let ctor_id = fld.new_id(ctor.node.id);
item_class(typms,
vec::map(items, fld.fold_class_item),
{node: {body: ctor_body,
dec: ctor_decl with ctor.node}
dec: ctor_decl,
id: ctor_id with ctor.node}
with ctor})
}
item_impl(tps, ifce, ty, methods) {