mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
assert that package qualifications are valid in platform modules
This commit is contained in:
parent
07622eb6fd
commit
7af401dd98
2 changed files with 25 additions and 1 deletions
|
@ -2195,6 +2195,30 @@ fn update<'a>(
|
|||
exposes_ids,
|
||||
..
|
||||
} => {
|
||||
let undefined_shorthands: Vec<_> = header
|
||||
.package_qualified_imported_modules
|
||||
.iter()
|
||||
.filter_map(|pqim| match pqim {
|
||||
PackageQualified::Unqualified(_) => None,
|
||||
PackageQualified::Qualified(shorthand, _) => {
|
||||
if header.packages.contains_key(shorthand)
|
||||
|| shorthand == &config_shorthand
|
||||
{
|
||||
None
|
||||
} else {
|
||||
Some(pqim)
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
// shorthands must be defined by the module!
|
||||
assert!(
|
||||
undefined_shorthands.is_empty(),
|
||||
"{undefined_shorthands:?} not in {:?} ",
|
||||
&header.packages
|
||||
);
|
||||
|
||||
work.extend(state.dependencies.notify_package(config_shorthand));
|
||||
|
||||
let is_prebuilt = if header.is_root_module {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue