提交 a62bd9ab 编写于 作者: M Marijn Haverbeke

Work around recursive type check for iface types

They are nominal, and can safely refer to themselves.
上级 c13f0874
......@@ -430,9 +430,6 @@ fn ty_of_item(tcx: ty::ctxt, mode: mode, it: @ast::item)
@it.ident);
let tpt = {bounds: bounds, ty: t};
tcx.tcache.insert(local_def(it.id), tpt);
ty::store_iface_methods(tcx, it.id, @vec::map(ms, {|m|
ty_of_ty_method(tcx, m_collect, m)
}));
ret tpt;
}
ast::item_impl(_, _, _, _) | ast::item_mod(_) |
......@@ -818,6 +815,13 @@ fn convert(cx: @ctxt, it: @ast::item) {
{bounds: bounds, ty: t_ctor});
write::ty_only(cx.tcx, dtor_id, t_dtor);
}
ast::item_iface(_, ms) {
let tpt = ty_of_item(cx.tcx, m_collect, it);
write::ty_only(cx.tcx, it.id, tpt.ty);
ty::store_iface_methods(cx.tcx, it.id, @vec::map(ms, {|m|
ty_of_ty_method(cx.tcx, m_collect, m)
}));
}
_ {
// This call populates the type cache with the converted type
// of the item in passing. All we have to do here is to write
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册