mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Report unexpected params
This commit is contained in:
parent
db76ab4015
commit
bc6a84a215
10 changed files with 137 additions and 24 deletions
|
@ -236,6 +236,14 @@ pub enum Problem {
|
|||
one_occurrence: Region,
|
||||
kind: AliasKind,
|
||||
},
|
||||
MissingParams {
|
||||
module_id: ModuleId,
|
||||
region: Region,
|
||||
},
|
||||
UnexpectedParams {
|
||||
module_id: ModuleId,
|
||||
region: Region,
|
||||
},
|
||||
}
|
||||
|
||||
impl Problem {
|
||||
|
@ -308,6 +316,8 @@ impl Problem {
|
|||
Problem::OverAppliedCrash { .. } => RuntimeError,
|
||||
Problem::DefsOnlyUsedInRecursion(_, _) => Warning,
|
||||
Problem::FileProblem { .. } => Fatal,
|
||||
Problem::MissingParams { .. } => Warning,
|
||||
Problem::UnexpectedParams { .. } => Warning,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -464,7 +474,9 @@ impl Problem {
|
|||
| Problem::UnnecessaryOutputWildcard { region }
|
||||
| Problem::OverAppliedCrash { region }
|
||||
| Problem::UnappliedCrash { region }
|
||||
| Problem::DefsOnlyUsedInRecursion(_, region) => Some(*region),
|
||||
| Problem::DefsOnlyUsedInRecursion(_, region)
|
||||
| Problem::MissingParams { region, .. }
|
||||
| Problem::UnexpectedParams { region, .. } => Some(*region),
|
||||
Problem::RuntimeError(RuntimeError::CircularDef(cycle_entries))
|
||||
| Problem::BadRecursion(cycle_entries) => {
|
||||
cycle_entries.first().map(|entry| entry.expr_region)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue