Leftover statement warning for pure statements

This commit is contained in:
Agus Zubiaga 2024-10-15 22:33:07 -03:00
parent 6e6382ab23
commit 69e026f8bb
No known key found for this signature in database
7 changed files with 140 additions and 69 deletions

View file

@ -598,6 +598,7 @@ impl Constraints {
| Constraint::Store(..)
| Constraint::Lookup(..)
| Constraint::Pattern(..)
| Constraint::EffectfulStmt(..)
| Constraint::True
| Constraint::IsOpenType(_)
| Constraint::IncludesTag(_)
@ -770,6 +771,8 @@ pub enum Constraint {
Index<PatternCategory>,
Region,
),
/// Expect statement to be effectful
EffectfulStmt(Variable, Region),
/// Used for things that always unify, e.g. blanks and runtime errors
True,
SaveTheEnvironment,
@ -858,6 +861,9 @@ impl std::fmt::Debug for Constraint {
Self::Pattern(arg0, arg1, arg2, arg3) => {
write!(f, "Pattern({arg0:?}, {arg1:?}, {arg2:?}, {arg3:?})")
}
Self::EffectfulStmt(arg0, arg1) => {
write!(f, "EffectfulStmt({arg0:?}, {arg1:?})")
}
Self::True => write!(f, "True"),
Self::SaveTheEnvironment => write!(f, "SaveTheEnvironment"),
Self::Let(arg0, arg1) => f.debug_tuple("Let").field(arg0).field(arg1).finish(),