mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Only add extra imported modules when it's the root
This commit is contained in:
parent
1e0f5c2b28
commit
73fa34ba31
1 changed files with 20 additions and 24 deletions
|
@ -4546,26 +4546,21 @@ fn build_header<'a>(
|
||||||
|
|
||||||
// This module depends on all the modules it exposes. We need to load those in order
|
// This module depends on all the modules it exposes. We need to load those in order
|
||||||
// to do things like report errors for them, generate docs for them, etc.
|
// to do things like report errors for them, generate docs for them, etc.
|
||||||
|
if info.is_root_module {
|
||||||
if let HeaderType::Platform {
|
if let HeaderType::Platform {
|
||||||
exposes,
|
exposes,
|
||||||
exposes_ids,
|
exposes_ids,
|
||||||
config_shorthand,
|
|
||||||
..
|
..
|
||||||
}
|
}
|
||||||
| HeaderType::Package {
|
| HeaderType::Package {
|
||||||
exposes,
|
exposes,
|
||||||
exposes_ids,
|
exposes_ids,
|
||||||
config_shorthand,
|
|
||||||
..
|
..
|
||||||
} = header_type
|
} = header_type
|
||||||
{
|
{
|
||||||
for (loc_module_name, module_id) in exposes.iter().zip(exposes_ids.iter().copied()) {
|
for (loc_module_name, module_id) in exposes.iter().zip(exposes_ids.iter().copied()) {
|
||||||
let module_name_str = loc_module_name.value.as_str();
|
let module_name_str = loc_module_name.value.as_str();
|
||||||
let pq_module_name = if info.is_root_module {
|
let pq_module_name = PackageQualified::Unqualified(module_name_str.into());
|
||||||
PackageQualified::Unqualified(module_name_str.into())
|
|
||||||
} else {
|
|
||||||
PackageQualified::Qualified(config_shorthand, module_name_str.into())
|
|
||||||
};
|
|
||||||
|
|
||||||
debug_assert!(!deps_by_name.contains_key(&pq_module_name));
|
debug_assert!(!deps_by_name.contains_key(&pq_module_name));
|
||||||
deps_by_name.insert(pq_module_name, module_id);
|
deps_by_name.insert(pq_module_name, module_id);
|
||||||
|
@ -4574,6 +4569,7 @@ fn build_header<'a>(
|
||||||
imported_modules.insert(module_id, loc_module_name.region);
|
imported_modules.insert(module_id, loc_module_name.region);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let package_entries = packages
|
let package_entries = packages
|
||||||
.iter()
|
.iter()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue