Suffixed pure function warning

This commit is contained in:
Agus Zubiaga 2024-10-16 16:20:29 -03:00
parent 1da8af390b
commit d22b2a79f5
No known key found for this signature in database
5 changed files with 59 additions and 3 deletions

View file

@ -41,6 +41,7 @@ pub enum TypeError {
ModuleParamsMismatch(Region, ModuleId, ErrorType, ErrorType),
PureStmt(Region),
UnsuffixedEffectfulFunction(Region, Symbol),
SuffixedPureFunction(Region, Symbol),
}
impl TypeError {
@ -67,6 +68,7 @@ impl TypeError {
TypeError::IngestedFileUnsupportedType(..) => Fatal,
TypeError::PureStmt(..) => Warning,
TypeError::UnsuffixedEffectfulFunction(_, _) => Warning,
TypeError::SuffixedPureFunction(_, _) => Warning,
}
}
@ -84,7 +86,8 @@ impl TypeError {
| TypeError::MissingModuleParams(region, ..)
| TypeError::ModuleParamsMismatch(region, ..)
| TypeError::PureStmt(region)
| TypeError::UnsuffixedEffectfulFunction(region, _) => Some(*region),
| TypeError::UnsuffixedEffectfulFunction(region, _)
| TypeError::SuffixedPureFunction(region, _) => Some(*region),
TypeError::UnfulfilledAbility(ab, ..) => ab.region(),
TypeError::Exhaustive(e) => Some(e.region()),
TypeError::CircularDef(c) => c.first().map(|ce| ce.symbol_region),