mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
Teach typeck.ast_ty_to_ty about ty_obj.
This commit is contained in:
parent
a99713265b
commit
91809a17ac
@ -108,7 +108,7 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty.t {
|
||||
|
||||
case (ast.ty_fn(?inputs, ?output)) {
|
||||
auto f = bind ast_arg_to_arg(getter, _);
|
||||
auto i = _vec.map[rec(ast.mode mode, @ast.ty ty),arg](f, inputs);
|
||||
auto i = _vec.map[ast.ty_arg, arg](f, inputs);
|
||||
sty = ty.ty_fn(i, ast_ty_to_ty(getter, output));
|
||||
}
|
||||
|
||||
@ -134,8 +134,18 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty.t {
|
||||
cname = t0.cname;
|
||||
}
|
||||
|
||||
case (_) {
|
||||
fail;
|
||||
case (ast.ty_obj(?meths)) {
|
||||
let vec[ty.method] tmeths = vec();
|
||||
auto f = bind ast_arg_to_arg(getter, _);
|
||||
for (ast.ty_method m in meths) {
|
||||
auto ins = _vec.map[ast.ty_arg, arg](f, m.inputs);
|
||||
auto out = ast_ty_to_ty(getter, m.output);
|
||||
append[ty.method](tmeths,
|
||||
rec(ident=m.ident,
|
||||
inputs=ins,
|
||||
output=out));
|
||||
}
|
||||
sty = ty.ty_obj(tmeths);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user