Update original_module when ascending DefMaps

This commit is contained in:
Jonas Schievink 2021-01-28 18:27:27 +01:00
parent 868887ec4e
commit 232b75394e

View file

@ -103,7 +103,7 @@ impl DefMap {
&self,
db: &dyn DefDatabase,
mode: ResolveMode,
original_module: LocalModuleId,
mut original_module: LocalModuleId,
path: &ModPath,
shadow: BuiltinShadowMode,
) -> ResolvePathResult {
@ -130,7 +130,10 @@ impl DefMap {
result.segment_index = result.segment_index.min(new.segment_index);
match &current_map.block {
Some(block) => current_map = &block.parent,
Some(block) => {
current_map = &block.parent;
original_module = block.parent_module;
}
None => return result,
}
}