mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Report unexpected params
This commit is contained in:
parent
db76ab4015
commit
bc6a84a215
10 changed files with 137 additions and 24 deletions
|
@ -3173,6 +3173,22 @@ fn to_pending_value_def<'a>(
|
|||
}
|
||||
});
|
||||
|
||||
match (module_import.params, env.modules_expecting_params.contains(&module_id)) {
|
||||
(None, true) => {
|
||||
env.problems.push(Problem::MissingParams {
|
||||
module_id,
|
||||
region,
|
||||
});
|
||||
}
|
||||
(Some(import_params), false) => {
|
||||
env.problems.push(Problem::UnexpectedParams {
|
||||
module_id,
|
||||
region: import_params.params.region,
|
||||
});
|
||||
}
|
||||
(None, false) | (Some(_), true) => { /* All good */}
|
||||
}
|
||||
|
||||
if let Err(existing_import) =
|
||||
scope
|
||||
.modules
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue