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,
|
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));
|
work.extend(state.dependencies.notify_package(config_shorthand));
|
||||||
|
|
||||||
let is_prebuilt = if header.is_root_module {
|
let is_prebuilt = if header.is_root_module {
|
||||||
|
|
|
@ -2,7 +2,7 @@ platform "effects"
|
||||||
requires {} { main : Effect.Effect {} }
|
requires {} { main : Effect.Effect {} }
|
||||||
exposes []
|
exposes []
|
||||||
packages {}
|
packages {}
|
||||||
imports [pf.Effect]
|
imports [Effect]
|
||||||
provides [mainForHost]
|
provides [mainForHost]
|
||||||
|
|
||||||
mainForHost : Effect.Effect {}
|
mainForHost : Effect.Effect {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue