mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 16:44:33 +00:00
kill process when would hang
This commit is contained in:
parent
865eff1956
commit
124abc3620
2 changed files with 36 additions and 1 deletions
|
@ -2367,6 +2367,20 @@ fn update<'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Builtin { .. } | Interface { .. } => {
|
Builtin { .. } | Interface { .. } => {
|
||||||
|
let qualified_modules = header
|
||||||
|
.package_qualified_imported_modules
|
||||||
|
.iter()
|
||||||
|
.filter(|pqim| match pqim {
|
||||||
|
PackageQualified::Unqualified(_) => false,
|
||||||
|
PackageQualified::Qualified(shorthand, _) => shorthand != &"",
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
assert!(
|
||||||
|
qualified_modules.is_empty(),
|
||||||
|
"package qualified modules not allowed in interfaces. Remove: {:#?} ",
|
||||||
|
qualified_modules
|
||||||
|
);
|
||||||
|
|
||||||
if header.is_root_module {
|
if header.is_root_module {
|
||||||
debug_assert!(matches!(
|
debug_assert!(matches!(
|
||||||
state.platform_path,
|
state.platform_path,
|
||||||
|
|
|
@ -1058,7 +1058,6 @@ fn module_cyclic_import_itself() {
|
||||||
err
|
err
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn module_cyclic_import_transitive() {
|
fn module_cyclic_import_transitive() {
|
||||||
let modules = vec![
|
let modules = vec![
|
||||||
|
@ -1148,3 +1147,25 @@ fn nested_module_has_incorrect_name() {
|
||||||
err
|
err
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
#[test]
|
||||||
|
fn module_interface_with_qualified_import() {
|
||||||
|
let modules = vec![(
|
||||||
|
"A",
|
||||||
|
indoc!(
|
||||||
|
r"
|
||||||
|
interface A exposes [] imports [b.T]
|
||||||
|
"
|
||||||
|
),
|
||||||
|
)];
|
||||||
|
|
||||||
|
let err = multiple_modules("module_interface_with_qualified_import", modules).unwrap_err();
|
||||||
|
assert_eq!(
|
||||||
|
err,
|
||||||
|
indoc!(
|
||||||
|
r"
|
||||||
|
"
|
||||||
|
),
|
||||||
|
"\n{}",
|
||||||
|
err
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue