mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-01 10:52:18 +00:00
Mark flex fx vars as pure after solving body
This commit is contained in:
parent
89a918cebe
commit
2859829ea8
3 changed files with 33 additions and 0 deletions
|
@ -851,6 +851,30 @@ fn solve(
|
|||
}
|
||||
}
|
||||
}
|
||||
FlexToPure(variable) => {
|
||||
let content = env.subs.get_content_without_compacting(*variable);
|
||||
|
||||
match content {
|
||||
Content::FlexVar(_) => {
|
||||
let desc = env.subs.get(Variable::PURE);
|
||||
env.subs.union(*variable, Variable::PURE, desc);
|
||||
|
||||
state
|
||||
}
|
||||
Content::Pure | Content::Effectful | Content::Error => state,
|
||||
Content::RigidVar(_)
|
||||
| Content::FlexAbleVar(_, _)
|
||||
| Content::RigidAbleVar(_, _)
|
||||
| Content::RecursionVar { .. }
|
||||
| Content::LambdaSet(_)
|
||||
| Content::ErasedLambda
|
||||
| Content::Structure(_)
|
||||
| Content::Alias(_, _, _, _)
|
||||
| Content::RangedNumber(_) => {
|
||||
internal_error!("FlexToPure: unexpected content: {:?}", content)
|
||||
}
|
||||
}
|
||||
}
|
||||
Let(index, pool_slice) => {
|
||||
let let_con = &env.constraints.let_constraints[index.index()];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue