Translate typeck.ty_fn to a TypeRef. Can compile int.rs test now.

This commit is contained in:
Graydon Hoare 2010-11-19 20:08:57 -08:00
parent c00bda539d
commit 6d92ca64a7

View File

@ -273,6 +273,19 @@ fn type_of(@trans_ctxt cx, @typeck.ty t) -> TypeRef {
}
ret T_struct(tys);
}
case (typeck.ty_fn(?args, ?out)) {
let vec[TypeRef] atys = vec();
for (typeck.arg arg in args) {
let TypeRef t = type_of(cx, arg.ty);
alt (arg.mode) {
case (ast.alias) {
t = T_ptr(t);
}
}
atys += t;
}
ret T_fn(atys, type_of(cx, out));
}
case (typeck.ty_var(_)) {
// FIXME: implement.
log "ty_var in trans.type_of";