// notion of a type. `getter` is a function that returns the type
// corresponding to a definition ID:
fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
+ alt (tcx.ast_ty_to_ty_cache.find(ast_ty)) {
+ case (some[option::t[ty::t]](some[ty::t](?ty))) { ret ty; }
+ case (some[option::t[ty::t]](none)) {
+ tcx.sess.span_err(ast_ty.span, "illegal recursive type "
+ + "(insert a tag in the cycle, if this is desired)");
+ }
+ case (none[option::t[ty::t]]) { } /* go on */
+ }
+ tcx.ast_ty_to_ty_cache.insert(ast_ty, none[ty::t]);
+
fn ast_arg_to_arg(&ty::ctxt tcx,
&ty_getter getter,
- &rec(ast::mode mode, @ast::ty ty) arg)
+ &ast::ty_arg arg)
-> rec(ty::mode mode, ty::t ty) {
- auto ty_mode = ast_mode_to_mode(arg.mode);
- ret rec(mode=ty_mode, ty=ast_ty_to_ty(tcx, getter, arg.ty));
+ auto ty_mode = ast_mode_to_mode(arg.node.mode);
+ ret rec(mode=ty_mode, ty=ast_ty_to_ty(tcx, getter, arg.node.ty));
}
fn ast_mt_to_mt(&ty::ctxt tcx,