Unsuffixed effectul function warning

This commit is contained in:
Agus Zubiaga 2024-10-16 16:08:33 -03:00
parent 75856ae804
commit 1da8af390b
No known key found for this signature in database
5 changed files with 115 additions and 4 deletions

View file

@ -40,6 +40,7 @@ pub enum TypeError {
MissingModuleParams(Region, ModuleId, ErrorType),
ModuleParamsMismatch(Region, ModuleId, ErrorType, ErrorType),
PureStmt(Region),
UnsuffixedEffectfulFunction(Region, Symbol),
}
impl TypeError {
@ -65,6 +66,7 @@ impl TypeError {
TypeError::IngestedFileBadUtf8(..) => Fatal,
TypeError::IngestedFileUnsupportedType(..) => Fatal,
TypeError::PureStmt(..) => Warning,
TypeError::UnsuffixedEffectfulFunction(_, _) => Warning,
}
}
@ -81,7 +83,8 @@ impl TypeError {
| TypeError::UnexpectedModuleParams(region, ..)
| TypeError::MissingModuleParams(region, ..)
| TypeError::ModuleParamsMismatch(region, ..)
| TypeError::PureStmt(region) => Some(*region),
| TypeError::PureStmt(region)
| TypeError::UnsuffixedEffectfulFunction(region, _) => Some(*region),
TypeError::UnfulfilledAbility(ab, ..) => ab.region(),
TypeError::Exhaustive(e) => Some(e.region()),
TypeError::CircularDef(c) => c.first().map(|ce| ce.symbol_region),