mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Leftover statement warning for pure statements
This commit is contained in:
parent
6e6382ab23
commit
69e026f8bb
7 changed files with 140 additions and 69 deletions
|
@ -39,6 +39,7 @@ pub enum TypeError {
|
|||
UnexpectedModuleParams(Region, ModuleId),
|
||||
MissingModuleParams(Region, ModuleId, ErrorType),
|
||||
ModuleParamsMismatch(Region, ModuleId, ErrorType, ErrorType),
|
||||
PureStmt(Region),
|
||||
}
|
||||
|
||||
impl TypeError {
|
||||
|
@ -63,6 +64,7 @@ impl TypeError {
|
|||
TypeError::ModuleParamsMismatch(..) => RuntimeError,
|
||||
TypeError::IngestedFileBadUtf8(..) => Fatal,
|
||||
TypeError::IngestedFileUnsupportedType(..) => Fatal,
|
||||
TypeError::PureStmt(..) => Warning,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,7 +80,8 @@ impl TypeError {
|
|||
| TypeError::BadPatternMissingAbility(region, ..)
|
||||
| TypeError::UnexpectedModuleParams(region, ..)
|
||||
| TypeError::MissingModuleParams(region, ..)
|
||||
| TypeError::ModuleParamsMismatch(region, ..) => Some(*region),
|
||||
| TypeError::ModuleParamsMismatch(region, ..)
|
||||
| TypeError::PureStmt(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