mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Report missing params
This commit is contained in:
parent
bc6a84a215
commit
922b1c44ef
16 changed files with 286 additions and 93 deletions
|
@ -2,7 +2,10 @@
|
|||
use std::{path::PathBuf, str::Utf8Error};
|
||||
|
||||
use roc_can::expected::{Expected, PExpected};
|
||||
use roc_module::{ident::Lowercase, symbol::Symbol};
|
||||
use roc_module::{
|
||||
ident::Lowercase,
|
||||
symbol::{ModuleId, Symbol},
|
||||
};
|
||||
use roc_problem::{can::CycleEntry, Severity};
|
||||
use roc_region::all::Region;
|
||||
|
||||
|
@ -33,6 +36,11 @@ pub enum TypeError {
|
|||
},
|
||||
IngestedFileBadUtf8(Box<PathBuf>, Utf8Error),
|
||||
IngestedFileUnsupportedType(Box<PathBuf>, ErrorType),
|
||||
MissingImportParams {
|
||||
module_id: ModuleId,
|
||||
region: Region,
|
||||
expected: ErrorType,
|
||||
},
|
||||
}
|
||||
|
||||
impl TypeError {
|
||||
|
@ -52,6 +60,7 @@ impl TypeError {
|
|||
TypeError::Exhaustive(exhtv) => exhtv.severity(),
|
||||
TypeError::StructuralSpecialization { .. } => RuntimeError,
|
||||
TypeError::WrongSpecialization { .. } => RuntimeError,
|
||||
TypeError::MissingImportParams { .. } => RuntimeError,
|
||||
TypeError::IngestedFileBadUtf8(..) => Fatal,
|
||||
TypeError::IngestedFileUnsupportedType(..) => Fatal,
|
||||
}
|
||||
|
@ -66,7 +75,8 @@ impl TypeError {
|
|||
| TypeError::BadExprMissingAbility(region, ..)
|
||||
| TypeError::StructuralSpecialization { region, .. }
|
||||
| TypeError::WrongSpecialization { region, .. }
|
||||
| TypeError::BadPatternMissingAbility(region, ..) => Some(*region),
|
||||
| TypeError::BadPatternMissingAbility(region, ..)
|
||||
| TypeError::MissingImportParams { region, .. } => Some(*region),
|
||||
TypeError::UnfulfilledAbility(ab, ..) => ab.region(),
|
||||
TypeError::Exhaustive(e) => Some(e.region()),
|
||||
TypeError::CircularDef(c) => c.first().map(|ce| ce.symbol_region),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue