mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Merge branch 'main' into module-params
This commit is contained in:
commit
eb68bf943a
159 changed files with 5937 additions and 22739 deletions
|
@ -2224,7 +2224,9 @@ fn update<'a>(
|
|||
|
||||
#[cfg(target_family = "wasm")]
|
||||
{
|
||||
panic!("Specifying packages via URLs is curently unsupported in wasm.");
|
||||
panic!(
|
||||
"Specifying packages via URLs is currently unsupported in wasm."
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// This wasn't a URL, so it must be a filesystem path.
|
||||
|
@ -4079,7 +4081,7 @@ fn load_packages<'a>(
|
|||
|
||||
#[cfg(target_family = "wasm")]
|
||||
{
|
||||
panic!("Specifying packages via URLs is curently unsupported in wasm.");
|
||||
panic!("Specifying packages via URLs is currently unsupported in wasm.");
|
||||
}
|
||||
} else {
|
||||
cwd.join(src)
|
||||
|
|
22
crates/compiler/load_internal/src/file/reporting.rs
Normal file
22
crates/compiler/load_internal/src/file/reporting.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
fn report_missing_package_shorthand2<'a>(
|
||||
packages: &[Loc<PackageEntry>],
|
||||
imports: &[Loc<ImportsEntry>],
|
||||
) -> Option<LoadingProblem<'a>> {
|
||||
imports.iter().find_map(|i| match i.value {
|
||||
ImportsEntry::Module(_, _) | ImportsEntry::IngestedFile(_, _) => None,
|
||||
ImportsEntry::Package(shorthand, name, _) => {
|
||||
let name=name.as_str();
|
||||
if packages
|
||||
.iter()
|
||||
.find(|p| p.value.shorthand == shorthand)
|
||||
.is_none()
|
||||
{
|
||||
Some(
|
||||
LoadingProblem::FormattedReport(
|
||||
format!("The package shorthand '{shorthand}' that you are importing the module '{name}' from in '{shorthand}.{name}', doesn't exist in this module.\nImport it in the \"packages\" section of the header.")))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
|
@ -1222,7 +1222,6 @@ fn module_cyclic_import_itself() {
|
|||
err
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn module_cyclic_import_transitive() {
|
||||
let modules = vec![
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue