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

@ -777,6 +777,31 @@ fn solve(
}
}
}
EffectfulStmt(variable, region) => {
let content = env.subs.get_content_without_compacting(*variable);
match content {
Content::Pure | Content::FlexVar(_) => {
let problem = TypeError::PureStmt(*region);
problems.push(problem);
state
}
Content::Effectful => state,
Content::RigidVar(_)
| Content::FlexAbleVar(_, _)
| Content::RigidAbleVar(_, _)
| Content::RecursionVar { .. }
| Content::LambdaSet(_)
| Content::ErasedLambda
| Content::Structure(_)
| Content::Alias(_, _, _, _)
| Content::RangedNumber(_)
| Content::Error => {
internal_error!("ExpectEffectful: unexpected content: {:?}", content)
}
}
}
Let(index, pool_slice) => {
let let_con = &env.constraints.let_constraints[index.index()];