In typeck, don't call ty::store_iface_methods on private methods

This was resulting in a different error message depending on whether
the private method you were trying to call was in the same crate
or a different one.
This commit is contained in:
Tim Chevalier
2012-03-26 10:45:04 -07:00
parent 21111660ca
commit 11610f9ca1
5 changed files with 37 additions and 3 deletions

View File

@@ -934,8 +934,8 @@ mod collect {
}
ast_map::node_item(@{node: ast::item_class(_,its,_), _}, _) {
let (_,ms) = split_class_items(its);
// Handling all methods here
let ps = ast_util::ignore_privacy(ms);
// Only public methods need to be stored
let ps = ast_util::public_methods(ms);
store_methods::<@ast::method>(tcx, id, ps, {|m|
ty_of_method(tcx, m_collect, m)});
}