Skip to content

Commit 91809a1

Browse files
committed
Teach typeck.ast_ty_to_ty about ty_obj.
1 parent a997132 commit 91809a1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/comp/middle/typeck.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty.t {
108108

109109
case (ast.ty_fn(?inputs, ?output)) {
110110
auto f = bind ast_arg_to_arg(getter, _);
111-
auto i = _vec.map[rec(ast.mode mode, @ast.ty ty),arg](f, inputs);
111+
auto i = _vec.map[ast.ty_arg, arg](f, inputs);
112112
sty = ty.ty_fn(i, ast_ty_to_ty(getter, output));
113113
}
114114

@@ -134,8 +134,18 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty.t {
134134
cname = t0.cname;
135135
}
136136

137-
case (_) {
138-
fail;
137+
case (ast.ty_obj(?meths)) {
138+
let vec[ty.method] tmeths = vec();
139+
auto f = bind ast_arg_to_arg(getter, _);
140+
for (ast.ty_method m in meths) {
141+
auto ins = _vec.map[ast.ty_arg, arg](f, m.inputs);
142+
auto out = ast_ty_to_ty(getter, m.output);
143+
append[ty.method](tmeths,
144+
rec(ident=m.ident,
145+
inputs=ins,
146+
output=out));
147+
}
148+
sty = ty.ty_obj(tmeths);
139149
}
140150
}
141151

0 commit comments

Comments
 (0)