This commit is contained in:
Florian Diebold 2019-01-27 17:23:49 +01:00
parent afce8e4426
commit d3df80dfe4
7 changed files with 17 additions and 27 deletions

View file

@ -109,8 +109,6 @@ impl Resolver {
self.scopes.iter().rev().find_map(|scope| match scope {
Scope::ModuleScope(m) => Some((&*m.item_map, m.module.clone())),
Scope::ModuleScopeRef(m) => Some((m.item_map, m.module.clone())),
_ => None,
})
}
@ -197,13 +195,13 @@ impl Scope {
fn collect_names(&self, f: &mut FnMut(Name, PerNs<Resolution>)) {
match self {
Scope::ModuleScope(m) => {
m.item_map[m.module.module_id]
.entries()
.for_each(|(name, res)| {
f(name.clone(), res.def.map(|def| Resolution::Def { def }));
})
}
Scope::ModuleScopeRef(m) => {
// TODO: should we provide `self` here?
// f(
// Name::self_param(),
// PerNs::types(Resolution::Def {
// def: m.module.into(),
// }),
// );
m.item_map[m.module.module_id]
.entries()
.for_each(|(name, res)| {