Skip to content

Commit 6d92ca6

Browse files
committed
Translate typeck.ty_fn to a TypeRef. Can compile int.rs test now.
1 parent c00bda5 commit 6d92ca6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/comp/middle/trans.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,19 @@ fn type_of(@trans_ctxt cx, @typeck.ty t) -> TypeRef {
273273
}
274274
ret T_struct(tys);
275275
}
276+
case (typeck.ty_fn(?args, ?out)) {
277+
let vec[TypeRef] atys = vec();
278+
for (typeck.arg arg in args) {
279+
let TypeRef t = type_of(cx, arg.ty);
280+
alt (arg.mode) {
281+
case (ast.alias) {
282+
t = T_ptr(t);
283+
}
284+
}
285+
atys += t;
286+
}
287+
ret T_fn(atys, type_of(cx, out));
288+
}
276289
case (typeck.ty_var(_)) {
277290
// FIXME: implement.
278291
log "ty_var in trans.type_of";

0 commit comments

Comments
 (0)