Skip to content

Commit 7eb596e

Browse files
committed
---
yaml --- r: 1157 b: refs/heads/master c: 91809a1 h: refs/heads/master i: 1155: 5125faa v: v3
1 parent 3c2fd30 commit 7eb596e

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: a99713265baca22050e1ab4994feaa70ac31667b
2+
refs/heads/master: 91809a17ac462e714e87b0150c0c525e52f69556

trunk/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)